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/

2
votes
1answer
24 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 ...
1
vote
1answer
20 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
29 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
14 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
14 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 : ...
0
votes
2answers
41 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
48 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 ...
1
vote
1answer
83 views

SItecore Glass Mapper 5.3.15 not loading children by default

I have upgraded the web site to sitecore 9.02 and since my project has a dependency on Glass mapper, i had upgraded Glass mapper to 5.3.15.My Glass mapper maps to the menu model and it does load the ...
0
votes
0answers
34 views

Glass.Mapper.Sc.91.Mvc don't have protected virtual void Copy() method

Currently, we are migrating from Sitecore 8.1 to Sitecore 9.1, so I upgraded glass mapper version to 9.1 using below NuGet package: Glass.Mapper.Sc.91.Mvc 5.3.17 But now I am getting an error, so ...
0
votes
0answers
45 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
38 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
32 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
81 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
126 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
24 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
165 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
54 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 ...
2
votes
1answer
140 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
87 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
41 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
36 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
84 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
152 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....
0
votes
0answers
69 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
40 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
68 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
53 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
45 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
75 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
54 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
114 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
48 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
158 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
138 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
199 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
111 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
71 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
429 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
414 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
280 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
35 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
71 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
243 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
52 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
175 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
190 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
449 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
636 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; ...
0
votes
1answer
541 views

Casting of SitecoreContext vs SitecoreService Which is fast?

In my project I am using following code to cast items. After some time, I came to know there are two way we can cast using SitecoreService and using glass mapper Sitecore Context. results.Select(p =...
0
votes
1answer
154 views

Mapping JSON object to Glass object not working - Ajax POST

I have a custom form and wanted to create complex Sitecore items. I am using TDS auto-generated class with GlassMapper. I am passing Glass object from controller to view, which then serialized to ...