Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

5
votes
2answers
70 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, ...
0
votes
1answer
32 views

Glass Mapper BeginRenderLink produces link to www.google.com

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. ...
0
votes
0answers
27 views

Sitecore 7.2 parsing a droplink field in viewmodel [duplicate]

I am trying to use a droplink in our events section to allow users to select a list of events. I setup the field as a droplink, with the label as the event name, and the event guid as the value. The ...
1
vote
1answer
38 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
32 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
30 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(...
0
votes
0answers
25 views

Glass Mapper returning null for pages that have modules that have sitecore security “Require login” set

We are in process of upgrading to Glass Mapper V4 and some of the pages have stopped working. These pages have modules that have sitecore security "Require login" set. These pages used to work fine ...
1
vote
1answer
92 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
22 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
0answers
24 views

Glass SitecoreQuery Property null

I have following SitecoreQuery property in a class called Product.cs [SitecoreQuery("/sitecore/content/Site/**[@@templateid='{0F03D8C4-D079-4726-8C06-CD9093ED576B}']", IsRelative = false, IsLazy = ...
0
votes
1answer
64 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
78 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
105 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
235 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
0answers
63 views

How to get children of GlassBase Item which have a version in the context language and language fallback is enabled

Using glass mapper, how to get children of an item which have a version in context language even when language fallback is enabled. We are using Language Fallback Module from the Sitecore Marketplace.
0
votes
0answers
94 views

Inconsistent “Service has been disposed” error from Glass.Mapper

Our Sitecore setup had been running just fine for more than a year but during the Christmas break at the end of last year we suddenly had one of our CD servers go down with the following error being ...
0
votes
1answer
198 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
82 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 ...
0
votes
1answer
274 views

Get parent item and it's all child item from solr searchresultItem

I have a requirement that needs to get particular item along with all child item or some of the child item using template id from solr searchresultitem. Can anyone help how to achieve this?
0
votes
1answer
46 views

“Type exists in multiple assemblies” with Glass and fluent config

I'm trying to set up fluent configuration for my project; it's non-Helix and the models and maps right now are in the web project. In the GlassMapperScCustom.cs, I've added this script (that's similar ...
0
votes
0answers
138 views

Generating same GlassMapper model classes without using TDS

In our project, we are using TDS to sync and serialize Sitecore items. We are also using TDS to generate GlassMapper model classes for all Sitecore Templates. But now, we are planning to use Unicorn ...
5
votes
1answer
552 views

How to get Descendants of a Sitecore item using Glass mapper?

Is there any direct approach to get descendants(child items and sub child items) of a Sitecore item in Glassmapper model. I know [SitecoreChildren] can be used in GlassMapper model to get Child items....
7
votes
1answer
408 views

What are the options for Glass Mapper model attributes?

I have looked through the documentation and tutorials on the Glass Mapper site, but I can't find a list of the different attributes that are available and what they do.
0
votes
1answer
101 views

Error when casting item to Complextype with Glass

Im having a problem with Glass Mapper, mapping/casting an item to a custom model. The Model with the complextype property (snippet): [SitecoreType(TemplateId = Templates.IDString, AutoMap = true)] ...
0
votes
3answers
197 views

Getting “Message: Service has been disposed, cannot create object” with Glass.Mapper

I'm using Glass.Mapper v4.5.0.4 and Sitecore 8.2 (rev. 170407). I'm doing an import into Sitecore and am using the SitecoreService.Save(T target) method for creating and saving items. I have the ...
0
votes
1answer
254 views

How is the anchor tag created when editing link with Glass Mapper?

I'm using Sitecore MVC with Glass Mapper. When I'm creating a component with a link field, I just add @Editable(myLink, x=> x.myLinkField) After setting the links properly on ...
0
votes
1answer
51 views

Locating “@this.HomePage.BulkPurchasesPage.Url” in the Sitecore tree

In a .cshtml View I've got: <a href="@this.HomePage.BulkPurchasesPage.Url"> I haven't been able to locate this so far. I don't see it on neither the Template __StandardValues nor on the ...
2
votes
1answer
119 views

Sitecore glass mapper error moving from 7.2 to 8.2

I'm in the processing of attempting to migrate manually our website which is currently running in sitecore 7.2 to a fresh install of 8.2 I've had a number of challenges, all of which were dll related,...
4
votes
2answers
284 views

Glass Mapper: DateTime format in experience editor

So I've wanted to change the default format of the date time field in the experience editor. I've had a look and most people suggest @Editable(item, x => x.Start_Date, x=>x.Start_Date....
1
vote
0answers
120 views

Is there any chance to build SXA custom component using Glass mapper?

It may be a very basic question as I'm beginner in sitecore SXA. Is there any possible way to build the SXA custom component using Glass Mapper? Thanks
2
votes
1answer
451 views

Glass Mapper - How do I configure an image field with Url Options?

If I were mapping a Link type field, I can override the default URL options like this. [SitecoreField(UrlOptions = SitecoreInfoUrlOptions.AlwaysIncludeServerUrl)] public Link ThisIsALink { get; set; }...
1
vote
1answer
123 views

Glass Mapper not caching a SitecoreContext.GetItem<IThing> request

Base class for a service providing data for an API controller on a 8.2 update-4 instance. Code's context is the web database and it's a simple case of using content search to find an item based on a ...
1
vote
1answer
128 views

Glass Mapper doesn't return null?

var model = GetContextItem<ICmsModel>(); I noticed that glass doesn't return null if ICmsModel is not derived from the Context Item... In this example, I'd expect glass to try and map it, but ...
1
vote
1answer
206 views

Glass.Mapper.Sc.SitecoreService.Create fails [closed]

We upgraded from sitecore 7.2 to 8.2 and glass mapper from 4.0.9.60 to 4.4.0.199/4.4.1.331-beta. After upgrade, new SitecoreService("master").Create(folderItem, name, language) is failing with below ...
1
vote
1answer
193 views

Glass Mapper generates an Empty Link Text for General Link Field that has a Media Link with an Empty Link Description

I've have a General Link field. Using 'Insert media link' I have it pointed to a Media Item under the Media Library. When the page is rendered in the Experience Editor Mode, Link correctly display ...
1
vote
2answers
127 views

Adding Custom (non sitecore field) property or method to Glass Mapper Class Returns Null

I've got an issue with extending the partial class from a TDS generated Template for glass mapper. Basically, I want to add a method to the underlying class to say have a custom string based on a ...
3
votes
1answer
282 views

Glass BeginRenderLink not showing text node

<a href="https://google.com" class="link" ></a> <a href="https://google.com" class="link" >Text Node</a> @using (Html.Glass().BeginRenderLink(m => m.Link, new { @class =...
1
vote
1answer
311 views

Mapping an interface template to a concrete class template in Code?

I have a Droplink type field called Formatter on a Table Column item. I would like GlassMapper to automatically map the selected value in the DropLink to the concrete class. Is this possible? using ...
4
votes
1answer
71 views

Glass Cast Failing With Infer Type True On Second Call

I'm using SitecoreContext.Cast(item, true, true) to map an item. It looks like elsewhere in the code, the same item has been casted to BaseType WITHOUT inferType = true before I make that call. When I ...
1
vote
0answers
181 views

Threading / Lock issue in Sitecore 8.1 [closed]

We had production outage on 11/7/2017 and accordingly I registered a ticket with sitecore support team and provided memory dump. Based on memory dump files here is their response: All three memory ...
3
votes
0answers
51 views

Glass Mapper Save for a specific language Modifies English language

When I am saving the Sitecore item using the below code. app.Language = itemLanguage; service.Save<Application>(app); It is saving in the respective language but modifying the values in the ...
3
votes
0answers
248 views

Glassmapper causing high CPU usage on Sitecore publishing in two CD servers

Sitecore support has suggested that following code has an issue after analyzing the w3wp process dumps. The Glass.Mapper.IoC.AbstractConfigFactory class has many lock syntax. This locked variable may ...
3
votes
1answer
149 views

How to specify children property when generating code with TDS and Glass Mapper

I have a data template called ProductListingPage. I also have a data template called Product. All of the Products will be in the content tree directly beneath the ProductListingPage. I am using ...
0
votes
0answers
32 views

GlassMapper: While creating object of SitecoreContext getting error [duplicate]

I have upgraded Sitecore 8.1 update 1 to Sitecore 8.2 update 5. Also i am using the GlassMapper. Everything working fine after upgrade. But when i open any page with Experience Editor i am getting ...
3
votes
1answer
215 views

Error when installing glass.mapper using nuget package

Install-Package Glass.Mapper.Sc -Version 4.4.0.199 I tried to install glass.mapper.sc (4.4.0.199) using the command above but I encounter an error. I haven't done anything yet to the files. This is ...
0
votes
1answer
321 views

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

IGlassBase public class IGlassBase : RenderingModel { public HtmlString Name { get { return new HtmlString(FieldRenderer.Render(this.Item, "Name")); } ...
3
votes
1answer
350 views

Bucket Items and Glass Mapper Retrieving

So I am trying to bring back a list of Bucket Items and map them using Glass Mapper. A couple of issues I am running into. I tried as you can see using the News glass model, but I get back several ...
5
votes
1answer
795 views

How do I render custom attributes on a General Link using the latest version of Glass Mapper

This is in relation to Add custom attributes to the General Link field and have it work in Experience Editor and Content Editor I would like to get Glass Mapper to automatically render the custom ...
1
vote
1answer
65 views

I need to override the SitecoreFieldLinkMapper, how do I ensure that the mapper isn't ran twice?

When overriding SitecoreFieldLinkMapper, I add my new custom mapper to the CreateResolver method so it can be ran with all the other custom mappers. How do I ensure that only this custom mapper is ran ...
3
votes
1answer
181 views

Glass BeginEditFrame to edit children of a referenced DropLink field

I am looking for some help in figuring out an appropriate approach to this setup. I have a Sitecore tree that looks something like this: content settings home potato spud1 spud2 The settings node ...