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

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/

0
votes
0answers
24 views

Not getting image using glass mapper [on hold]

I Am using sitecore 9.1 and glass mapper to make the image Field Editable. I have used @Html.Glass().RenderImage(x => x.Image, isEditable: true) .. the image is editable in ExperienceEditor ...
1
vote
1answer
19 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
56 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
40 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
25 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
56 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
30 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
30 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
32 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
71 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
40 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
39 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
44 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
39 views

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

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
30 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
45 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
38 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
71 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
24 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
81 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
103 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
111 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
79 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
62 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
314 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
277 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
212 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
64 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
29 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
208 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
41 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
138 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
155 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
367 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
543 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
135 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
134 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
455 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
138 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
438 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
56 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
260 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 ...
6
votes
1answer
924 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....
10
votes
1answer
1k 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
157 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
380 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
312 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
68 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 ...
5
votes
2answers
458 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....