We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [glass-mapper]

Questions relating to the Glass.Mapper.Sc ORM framework. More information about the framework is available here: http://www.glass.lu/

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

Glassmapper 4.5.0.4 [on hold]

I am using Sitecore glassmapper 4.5.0.4 in Sitecore 9 update 1. I am using a view rendering as (@model DSG.Data.Models.Developers.Product.Downloads.ProductReleaseDetailsViewModel) but getting error as ...
0
votes
0answers
35 views

Glass mapper returning null for shared fields with values

I have an SXA site. It has language fallback enabled on the site node. Page and component datasource templates' standard values have had both their item level and field level fallback enabled for non-...
1
vote
1answer
32 views

String not geting rendered in Experience Editor

Environment: Sitecore 9.0.2 + Glass mapper I have a model class like this: public class SingleStack { public Glass.Mapper.Sc.Fields.Image Logo { get; set; } public string ...
2
votes
1answer
43 views

Glassmapper | Cannot save a class that does not contain a property that represents the item ID

Environment: Sitecore 9.0.2 + Glass Mapper I have a class like this: public class Sample { public Glass.Mapper.Sc.Fields.Image Logo { get; set; } public string Destination_Name { get; set; }...
3
votes
0answers
67 views

SitecoreRequestScopeModule holding many objects leading to memory leak

We are seeing a steady memory growth on our Sitecore 8.2 update 1 application. We had AUTOFAC DI previously and have been completely replaced with Sitecore OOB MS DI. We followed some guidance from ...
1
vote
1answer
62 views

Rendering images through TreelistEx

Environment: Sitecore 9.0.2 + Glassmapper I am trying to create a component like this. So in the template, for the images (stored in Sitecore Media Library), I have taken a field of type TreeListEx. ...
1
vote
1answer
24 views

Glass GetItems not returning sorted items

I am not able to get glass to return items sorted correctly. I have this code. var options = new GetItemsByQueryOptions(new Query($"<mypath>/*")); var myitems= this.contentRepository....
0
votes
0answers
66 views

MVC Layout model is empty after Glass Mapper Upgrade

We recently upgraded from Sitecore 8.2.0 to Sitecore 9.2.0. Along with other packages, we also upgraded to the latest compatible version of Glass Mapper 5 for Sitecore 9.2.0. We use Simple Injector ...
0
votes
0answers
46 views

Error when trying to serialize a Glass Mapper object

I am doing a Sitecore / Glass Mapper upgrade from 7.2 -> 9.1.1. In 7.2 this code worked but now it is throwing an error. We are simply trying to serialize a custom class. The line of code looks ...
1
vote
1answer
138 views

High CPU and Memory with 2 million glass disposables

We have been seeing the high CPU and constant growth of memory. When analyzing the memory dump I noticed that the memory is occupied by 2 million Glass Mapper objects. Has anyone faced this issue and ...
2
votes
1answer
71 views

Mapping Class with multiple Sitecore templates in [SitecoreType()] Attribute

I have to map a class with more than one template in GlassMapper. My code is like below. [SitecoreType(TemplateId = "{6173F07E-BC5B-4409-A75A-DF1B0D117C41}", AutoMap = true, EnforceTemplateGlass....
0
votes
1answer
31 views

Using Glass to add content with fluent config - map to interface and concrete class

My typical build-out for Glass and fluent config is to use an interface and map file (using SitecoreGlassMap) for modeling, but I know if I need to use the model to add data to Sitecore I can't use ...
-1
votes
1answer
79 views

Glass Mapper is not returning an Image Field

I have a model that looks like this: [Serializable] [SitecoreType(TemplateId = "{guid}", AutoMap =true)] public class EventInfo : GlassBase { public virtual string PageTitle { get; set; } ...
0
votes
0answers
44 views

SitecoreQuery issue in glass mapper

I use glass mapper 5.3 and I use SitecoreQuery in this field: [SitecoreQuery("/sitecore/content/Newsroom/Data/Enumerations/Companies/*")] public virtual IEnumerable<EnumerationValueItem> ...
0
votes
0answers
27 views

Sporadic Glass Error - The model item passed into the dictionary is of type 'Sitecore.Mvc.Presentation.RenderingModel'

I've inherited a Sitecore upgrade from 8.0 to 8.2u7 half way through and I've found this issue which only sporadically happens. The model item passed into the dictionary is of type 'Sitecore.Mvc....
0
votes
0answers
55 views

Glass mapper return different type - GlassBaseProxy

We use Glass mapper 5.3 TDS generate this code public partial class AggregatorComponentItem : GlassBase, IAggregatorComponentItem public partial class GNR_Press_ReleaseItem : GlassBase, ...
0
votes
1answer
23 views

Map user profile fields via Glass

I've created a custom user profile and attached it to a user type. When I do a GetUser and tell it I want the profile properties, is there a mechanism to map this data to a Glass model, or is this ...
0
votes
0answers
20 views

Template id not getting set using glassmapper _sitecoreContext.GetCurrentItem

I have an item item1 in sitecore with redering rendering1 in its presentation details. The rendering rendering1 has its datasource and is a controller rendering. The datasource of the rendering one ...
1
vote
1answer
94 views

Glassmapper 5 SitecoreChildren listing items even if the version count is 0

We upgraded Glass Mapper version from 4.2.1.190 to 5.4.21.0. In our model, we are using [SitecoreChildren(InferType = true)] to get the child items. For few of the child items, language fallback is ...
0
votes
0answers
28 views

Cannot resolve parameter 'Glass.Mapper.Sc.ISitecoreContext context'

I am getting below exception while doing a service call in Sitecore 9.1, Cannot resolve parameter 'Glass.Mapper.Sc.ISitecoreContext context' of constructor 'Void .ctor(Glass.Mapper.Sc....
4
votes
1answer
233 views

How do I map a list of Templates with Glass Mapper?

I've got a TreeList field on one of my templates that allows me to select multiple templates. I'm having trouble mapping this to my model with Glass Mapper. [SitecoreType(TemplateId = "{Template-Id-...
1
vote
2answers
166 views

Glassmapper 5.1 Error when Datasource has no version

We recently upgraded our Sitecore to 9.1 and also Glassmapper5.4.21 along with it. What we noticed is that some of the view renderings have a data source that does not have a version in a particular ...
1
vote
1answer
68 views

Editable in a foreach loop?

I know I've done this before but I just don't remember the proper syntax. I have a page where the model is EventItem, and EventItem has a list of EventSpeakers and each speaker has an image field. I ...
0
votes
1answer
184 views

The model item passed into the dictionary is of type 'Sitecore.Mvc.Presentation.RenderingModel'

We recently upgraded to 9.1 and updated our glassmapper to 5.4.1. After doing the upgrade and running our application I am getting this error. We dont have any model definition in siteocre and this ...
1
vote
1answer
39 views

Can I use Content Search with Glass to query children of a specific template?

My Sitecore Item has children of different Templates. To query them, I use the following field declaration: [SitecoreQuery("*[@@templateid = '{ID of my Template}']", InferType = true, IsRelative = ...
1
vote
1answer
173 views

Glass Mapper - Item not null when language version not present

I'm using Glass 5.4.18 with Sitecore 9.0.2. I have a base template for my site that has language fallback turned on by default, but for a few items the client wants to disable language fallback so the ...
2
votes
1answer
146 views

Sitecore GlassMapper and Json.NET

I need to pass parameters in Json format from Sitecore item. I am getting Sitecore item using GlassMapper. public interface ISomeType { //some fields } public interface ISomeFolder { ...
1
vote
2answers
90 views

Map text field to nested object

I have a model which has two nested classes within. I am unable to find any resources how to map this correctly. In Sitecore the Address.cs corresponds to the template Address which has a droplink to ...
2
votes
1answer
43 views

Dealing with different types of SitecoreParent

Templates A and B both inherit from Templates C. I have an item that can have either an A or a B as parent. How can I use the [SitecoreParent] attribute in order to retrieve either according to the ...
0
votes
1answer
66 views

Mapping NameValue list using Glass Mapper

I'm using Glass Mapper in my Sitecore 9 solution. I have a NameValueList field in my template. I'm trying to map it using the below syntax in the Model class. But in the actual Json output, I'm only ...
1
vote
1answer
99 views

How do I programmaticaly set an image on glassmapped item

So I have a glassMapped item with an image. [SitecoreType(TemplateId = TemplateIdConstants.NationalChain, EnforceTemplate = SitecoreEnforceTemplate.Template)] public interface IChain : IGlassBase { ...
0
votes
0answers
38 views

Re-rendering Glass Mapper / TDS Models removes interfaces

I added and modified several objects in my project to get the database in sync with the project. There are some objects I modified in the project and that changed their revision number. The problem ...
0
votes
0answers
55 views

How to upgrade Glass Mapper code that uses AbstractGlassUserControl?

I am upgrading some Glass Mapper code that I inherited. The previous version of Glass Mapper was v3 and I am upgrading to v5.3.17. I have a class that looks like this: public class MyRepository : ...
-1
votes
2answers
149 views

Space with 'Name Value List' in Sitecore

We are using Glass Mapper to map the values from Sitecore. System.Collection.Specialized.NameValueCollection is used in Glass Mapper class to map Name Value List from Sitecore. This example data is ...
0
votes
1answer
62 views

Experience Analytics page conflict with Glass Mapper

I'm getting the following error message when I go to Experience Analytics from the dashboard in 9.0.2 (rev. 180604). We are using Glass Mapper elsewhere in the application, but there's no ...
2
votes
1answer
298 views

Sitecore Glass Mapper 5.3.15 not loading children by default

I have upgraded the website to Sitecore 9.0.2 and since my project has a dependency on Glass mapper, I have upgraded Glass mapper to 5.3.15. My Glass mapper maps to the menu model and it does load ...
0
votes
0answers
52 views

Some fields are not being saved in experience editor

I have a component that has following fields: Title Image Link Title Link Among these fields, Title and Link Title are not being saved while editing in the Experience Editor, upon ...
1
vote
0answers
84 views

Glass GetRenderingParameters SQL query

We are using the method GetRenderingParameters<T>() from Glass in many different places in our code. This method works correctly, it returns the rendering parameters as a strongly typed object. ...
1
vote
1answer
102 views

Droplink value is always returning null in post action

I am trying to build a form which contains state as droplink and given datasource as states . here's the snippets of my employee model and state. i am getting all the states in the get action of ...
1
vote
0answers
215 views

Problem upgrading Glass Mapper from v4 to v5.3.15

I’m trying to upgrade our solution from Sitecore 9.0.2 to Sitecore 9.1 and I’ve also updated Glass Mapper from version 4 to version 5.3.15. In my Service registration I’ve added the following three ...
1
vote
1answer
44 views

Equals sign (=) added after valueless query string parameters

When rendering an external link from a General Link field using the Glass Mapper BeginRenderLink helper, any query string parameters without values are getting an equals sign (=) added after them. An ...
1
vote
1answer
1k views

How to get children of an item via glass mapper?

I am building a navigation component using glass mapper. The problem I am facing is not being able to get children items of a navigation item. Right now I am only getting Parent navigation items. ...
1
vote
1answer
109 views

Dynamically Generated Rendering not displaying in experience editor in SXA Multi Tenant Solution [closed]

When working with with SXA inside of a multi-tenant solution, we are building a component to generate an HTML sitemap. We have implemented a recursive function to generate the html sitemap ...
5
votes
1answer
664 views

After upgrading to Glass Mapper 5, unable to globally enable lazy loading

In the implementation using Glass Mapper 4.3.x, I was enabling Lazy Loading in GlassMapperScCustom: public static IDependencyResolver CreateResolver(){ var config = new Glass.Mapper.Sc....
0
votes
0answers
143 views

Implementing a Carousel with Glass Mapper for Sitecore

I am new to Sitecore hence, looking for help from Sitecore enthusiasts. I am implementing a carousel using Glass Mapper (V8.2) I have a data source (a simple folder) which has three carousels as ...
1
vote
1answer
83 views

Is there anything wrong with using BeginRenderLink and changing the querystring parameters with a controller rendering?

Right now in our view we have something like this: using (BeginRenderLink(x => x.ButtonLink, new { @class = "primary-button", style = style }, isEditable: true)) { @Editable(x => x....
1
vote
1answer
56 views

Is there a way to append an indexed field to a glass mapper object?

I'm generating a custom sitewide search by indexing the rendered HTML of the pages on my site. Some pages will have a title and description field defined to display in the results, however, some ...
0
votes
1answer
236 views

How do I map a Time field using Glass.Mapper?

I've got a field in my template of type Time, the template is published and I've entered a value in my item but I'm not getting a value in my datasource. I've tried DateTime and TimeSpan for the ...
2
votes
0answers
400 views

Glass Mapper v5 Item creation issue

I'm using Sitecore 9.0 Update 2 with Glass Mapper.Sc version 5.2.13 I'm trying to create items in Sitecore using GlassMapper and the following code repository.RequestContext.SitecoreService....
1
vote
0answers
123 views

Using Glass Mapper Interface mapping is there a way to create a concrete object without adding the item to the database?

I'm working on creating an item in the sitecore database, I want to add the entire completed object to the database and not element by element. Is there a way to get interface mapping to create a ...