Questions tagged [glass-mapper]

Glass.Mapper is a Sitecore module that provides an ORM solution for the Sitecore CMS.

Glass.Mapper is an open source object mapping framework for .NET CMS systems

302 questions
5
votes
2 answers

Sitecore PageEditor randomly shows error with Glass.Mapper

I sometimes receive an error when I open a page in page editor mode on my Sitecore site using Glass.Mapper. You cannot save a class that does not contain a property that represents the item ID. Ensure that at least one property has been marked…
Zenima
  • 380
  • 2
  • 14
5
votes
2 answers

BeginRenderLink Sitecore Glass Mapper

I have two fields in Sitecore: Read More Link. Read More Title. I'm using sitecore MVC with glass mapper, and I need to make both fields editable from page eidtor, so I'm using this code :
Ayman Barhoum
  • 1,255
  • 1
  • 16
  • 31
5
votes
1 answer

Can I use relative fast queries in the SitecoreQuery attribute?

I have a working installation of Sitecore 7 + Glass Mapper 3 which I am looking to optimize. An example of my code is: [SitecoreQuery(".//*[@@templateid = '{011EC776-D9F3-4D73-8D8D-E454417E7574}']", …
Steve McGill
  • 501
  • 2
  • 15
5
votes
3 answers

Get absolute Url for internal Links with Glass Mapper for Sitecore

My item template has a field for a General Link and is representing by the following class: [SitecoreType] public class MenuLink { [SitecoreField(FieldName = "Link")] public virtual Link Link { get; set; } } Now my link field contains…
Kevin Brechbühl
  • 4,717
  • 3
  • 24
  • 47
5
votes
2 answers

Sitecore Glass Mapper: Attributes on interfaces or concrete classes?

We're new to Glass mapper and wanted to use it in our Sitecore project. When looking at the tutorials we noticed there were no deep examples of how to set up the deep inheritance that Sitecore allows. When browsing the web we noticed that there's…
IvanL
  • 2,475
  • 1
  • 26
  • 39
5
votes
1 answer

Image list in Glass with Sitecore

I am using Glass library as ORM for Sitecore. I have a field Images which contains the list of images. Since I want to access this from my .NET code, I have written a partial class which has the field images like: [SitecoreField] public virtual…
PM.
  • 1,735
  • 1
  • 30
  • 38
4
votes
2 answers

Sitecore rich text field in page editor is not editable when it contains HTML formatting

I have a number of fields that are editable in Page Editor. One of them is a rich text field. This is the html: @foreach (var speaker in Model.Speakers) {
Erica Stockwell-Alpert
  • 4,624
  • 10
  • 63
  • 130
4
votes
0 answers

Glass Mapper SitecoreInfo.Url not working as expected on multisite

I have an issue with mapping SitecoreInfoType.Url on a sitecore multisite solution. I have in sitecore 2 websites: Site A Site B Site A contains some articles: www.Site-A/Articles/Article 1 www.Site-A/Articles/Article 2 On our main "Article…
Sandor
  • 51
  • 3
4
votes
1 answer

Sitecore Glass Mapper Get All Siblings

I am trying to get all items at the current item level. I am using Glass Mapper SitecoreQuery for the same. I am able to get the current item but not able to map all siblings public class TestModel:BaseModel { [SitecoreQuery("../*")] public…
Deb
  • 391
  • 2
  • 20
4
votes
2 answers

Map Droplist item to complextype using Glass.Mapper

I have created two Sitecore templatates MenuItem and MainNavigation. I have created two interfaces wich are based on these templates: [SitecoreType(TemplateId = "{C824E484-F4A6-475C-AFAF-308FF4BBA5A9}", AutoMap = true)] public interface…
Rene
  • 526
  • 6
  • 18
4
votes
2 answers

Sitecore: Glass Mapper Code First

It is possible to automatically generate Sitecore templates just coding models? I'm using Sitecore 8.0 and I saw Glass Mapper Code First approach but I cant find more information about that.
Makler
  • 51
  • 4
4
votes
1 answer

Glass mapper populate list from Link path

I'm trying to populate a list on my current model with subitems from a different folder. On my current model I want to define a field of type General Link in which I will select an item from Sitecore who has different subitems. The "public virtual…
Dora
  • 135
  • 6
4
votes
2 answers

How to get template ID of an item with glass.mapper?

Is there a way to check the template ID of a Sitecore item with glass mapper? My business logic would do the following: Get the context item If the context item has specific template it is OK If it has a different template, then find another item…
Tamas Molnar
  • 797
  • 2
  • 9
  • 25
4
votes
1 answer

Glass mapper Editable() with List<> items not working?

I have a list of items I'm reading out of sitecore and looping in my View. The items are quite stright forward and are simply output as a series of
  • Model [SitecoreType(AutoMap = true)] public class Model { [SitecoreId] public Guid Id {…
  • Liam
    • 27,717
    • 28
    • 128
    • 190
    4
    votes
    3 answers

    Why Glass Mapper Returning Null Values?

    I'm using Glass V4. I have a set up of MVC Web Area Project. I have installed the Glass Mapper in the Main Project (WebProject). I'm trying to do the Glass Casting in my Area Project. public class ContactController : SitecoreController { …
    Sakthivel
    • 553
    • 1
    • 5
    • 12
    1
    2
    3
    20 21