Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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/

1
vote
1answer
36 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
39 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 { ...
2
votes
2answers
38 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
33 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
27 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
34 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
17 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
31 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
63 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
50 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
115 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
49 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 ...
0
votes
0answers
48 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. ...
0
votes
1answer
37 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
117 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 ...
0
votes
1answer
187 views

Rendering Parameters with Glass Mapper for sitecore

I am trying to implement rendering parameters with Glass Mapper. However not able to get it correct. [SitecoreType(TemplateId = "{8D9E5C18-D864-40F0-AFEE-1575C7DAB2ED}", AutoMap = true)] public ...
1
vote
1answer
27 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
279 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
66 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 ...
3
votes
1answer
209 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
96 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
45 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
41 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
122 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
211 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
89 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 ...
-1
votes
1answer
44 views

Razor-Inserted Value rendering as Type String instead of Expected Value

We're encountering a strange issue from one environment to the other that we can't seem to get to the bottom of. We're using Azure for hosting as well. On all environments, we have the following code:...
2
votes
1answer
86 views

How to change Glassmapper's BeginEditFrame enclosing html element

I am using Glassmapper's BeginEditFrame method to make a treelist editable in Experience Editor. I am using <%using (BeginEditFrame(Model, "Edit Location", x => x.Locations)) {%> <% if (...
1
vote
1answer
58 views

Can I have a field that is populated with values from my Lucene index exclusively?

Sitecore 8.1, Lucene index. I have a (Glass) field marked with [SitecoreIgnore] that I would like to be populated with values from the index. More specifically, the index has a number of strings ...
1
vote
1answer
57 views

The type is not supported by SitecoreIdMapper

I'm trying to get children of a specific template under an item using: [SitecoreQuery("./*[@@templateid='{051E9E07-F488-41EA-A87E-0A92EA32B86B}']", IsRelative = true)] public virtual ...
1
vote
1answer
91 views

Experience Editor edit mode doesn't work if “website” site node is not present [duplicate]

We are using a custom patch into Sitecore.config to define our own site node. It has pretty much the exact same settings as the default "website" site node except for the name, hostname and rootpath. ...
1
vote
1answer
63 views

Is there a way to change icon when using GlassMapper BeginEditFrame?

I need to edit complex sitecore fields in Experience Editor and I am using Glass's BeginEditFrames for that as it only requires change in code. I am using: using (BeginEditFrame(Model, "Edit ...
2
votes
1answer
142 views

Using Glass (v5) to query a bucket for a certain template containing value in name

I have had a to get child items in a tree where their name contains a value. This was working until I updated the node (and its templates) to be a bucket. Now I can't get the query to return anything. ...
2
votes
1answer
61 views

Using Glass().Editable() in a property tag causes unexpected behavior

Experiencing an odd issue when using @Html.Glass().Editable() inside the value property of an input element. My markup is: <input type="submit" name="search" value="@Html.Glass().Editable(Model, x ...
1
vote
2answers
207 views

Accessing IMvcContext/ISitecoreService in a view rendering

This is using Sitecore 9.0.2 and Glass 5.1.10. I'm trying to figure out the best way to access the IMvcContext (or ISitecoreService) in a view rendering. Using controller rendering is very ...
2
votes
1answer
155 views

Glass always returns null

I am running into an issue for a site we are upgrading from 8.1 to 9.0.1. In the process of refactoring and updating the code base, we have upgraded Glass from v3 to v4.5. After doing so, every Glass ...
0
votes
1answer
231 views

Glass RenderLink not rendering right media url

Sitecore verison - 9.0.2 Glass version - 5.0.6.0 We are trying to use Glass @RenderLink to render a pdf media item, it's generating anchor tag with below path /sitecore/media-library/site-content/...
0
votes
1answer
119 views

Glass Error opening Experience Editor (ObjectToSwitchTo)

I'm using @Html.Glass().Editable(Model, x => x.MyProperty) for some of our single-text / rich text fields. When I load the site with this code in the view everything looks fine. However, when I ...
1
vote
2answers
80 views

Occasional error on glass 4.5.0.4 on sitecore 9 “Page editing error. Could not find property”

Getting occasional error on glass 4.5.0.4 on Sitecore 9. "Page editing error. Could not find property **** on type ****BaseItemModel at Glass.Mapper.Utilities.GetGlassProperty.... at Glass.Mapper....
6
votes
2answers
498 views

Getting value out of Sitecore DropLink with GlassMapper

I have been working on a problem for a bit now, and coming back to it again. I have most of it taken care of, thanks to previously posted questions Sitecore 7.2 parsing a droplink field in viewmodel, ...
1
vote
1answer
492 views

Glass Mapper BeginRenderLink produces link to www.google.com [closed]

Sitecore 8.1 Revision 160519 Glass Mapper 4.5.0.4 I have a link field in Sitecore set to an internal link. If I just render the link on a page (link.GetUrl()) it produces the correct relative Url. ...
1
vote
2answers
322 views

How to read PDF files from multilist using glass mapper?

I have uploaded all PDF files under media library. In one of my template, I added multilist with datasource to the pdf files which are created under media Library. Now in my code,I have to read the ...
2
votes
0answers
36 views

Adding extra empty lines in GlassData.cs through TDS

For some reason a lots of empty lines are added when TDS regenerate GlassData.cs. This makes bitbucket diff hard and a lot longer to read, because the previous version didn't have all these blank ...
0
votes
0answers
78 views

Is there a way to use complex types as SitecoreFields?

Is there a way to use complex types to duplicate property declarations in a Glass model? For example, imagine a page with 5 images on it and each image needs a URL and alt text: [SitecoreType(...
1
vote
1answer
279 views

Language fallback for Non-Shared fields are not working with Glass mapper and Sitecore 9?

I have a site configured with an item and field language fallback. We are using glassmapper as an ORM. We have used VersionCountDisabler in the code and global.asax level. Settings: ...
1
vote
1answer
57 views

New Template fields => is GlassData.cs re-generated automatically, no manual action needed?

I've added 4 new fields under /Sitecore/Templates. Just to confirm, are my following assumptions correct? I feel I'm closing in from experiments alone, but among so many things to know and read about,...
0
votes
1answer
191 views

Is it possible to display field name in View(cshtml) using glass mapper

I am trying to display field name using Glass Mapper in view rendering in following format: FieldName - FieldValue FieldName - FieldValue Ex: Country - USA City - New York I ...
0
votes
1answer
204 views

After upgrade to Sitecore 8.2 and GlassMapper 4.3.4.197 “Cannot create an abstract class.” error appeared [closed]

After performing an upgrade from 8.1 to Sitecore 8.2 and GlassMapper 4.3.4.197 (from 4.0.3) I faced the following error described below. All the GlassMapper.Sc.Custom files remain the same and it ...
0
votes
1answer
484 views

Glass mapper BeginRenderLink stripping query string parameter that is a Url with ga parameters

I'm using glass mapper BeginRenderLink to output some links: @using (BeginRenderLink(link, n => n.Destination, isEditable: true)) { @RenderImage(link, lnk => lnk.LinkIcon, isEditable: true, ...
3
votes
1answer
665 views

Map Sitecore “Name Value List” field to NameValue collection

Im trying to map Sitecore "Name Value List" field to NameValueCollection using below code which is not working. [SitecoreType(AutoMap = true)] public interface IManifest { string Title { get; ...