Questions tagged [glass-mapper]

Glass.Mapper is a Sitecore module that provides an ORM solution for the Sitecore CMS.

Glass.Mapper is an open source object mapping framework for .NET CMS systems

302 questions
0
votes
3 answers

Map two templates for different sites

We are developing a multisite sitecore solution where each sites can have have their own News as well as able to display the combined news from other Sites. Problem: Each site have their unique News requirements where 90% of the template fields…
Nil Pun
  • 17,035
  • 39
  • 172
  • 294
0
votes
1 answer

how to map sitecore items using glassmapper class in web froms..?

i'm creating demo project there i create Item which contains sub-Item now i want to render these using web controller my code like this site items created as following image and my glass mapper code is as: public static class GlassMapperSc { …
0
votes
2 answers

Glass Mapper -ERROR Failed to render field

I'm running into the below error message when I open the sitecore page in edit mode. Any idea what seems to be the problem. I was using Glass mapper fluent configuration and it's working fine for a few other classes. The issue seem to be with just…
0
votes
1 answer

How to enable VersionCountDisabler for Glass Mapper in Sitecore for SitecoreQuery and SitecoreChildren attributes

The glass mapper will return null object or (no items) for SitecoreQuery and SitecoreChildren attribute that are placed on the GlassModels. These attributes don't take any such parameter where I can specify them to return items if they don't exist…
T Malik
  • 45
  • 1
  • 7
0
votes
1 answer

For Glass Mapper if Internal Link is selected for General Link field then Glass Mapper is using Item Name for Link Text

How can we avoid this behavior so that if Link Description is set on the General Link Field then it takes that value and not fallback to Item name ? Glass Mapper is using the Item name of the target item for type of Internal Link in General Link…
T Malik
  • 45
  • 1
  • 7
0
votes
2 answers

Sitecore Glass Childlist Runtime Error

I'm working in a Sitecore project that uses Glass and code generation to create glass classes. I wanted an easy way to get a child list on every Glass class type so on IGlassBase I added IEnumerable Children { get; set; } and on…
Teeknow
  • 1,015
  • 2
  • 17
  • 39
0
votes
1 answer

What type can I use to represent the __Renderings field in a Glass model?

I would like to access the Sitecore built in "__Renderings" field as a property of a Glass model. What type can I use to do this ? Thanks.
epik phail
  • 195
  • 8
0
votes
3 answers

Sitecore SearchResulItem - fluent API?

In Sitecore, how can I define index field names on derived SearchResultItem class' properties other than [IndexField] attribute? I'm trying to use the same interfaces I use for Glass.Mapper model definitions, and it already contains [SitecoreField]…
Zenima
  • 380
  • 2
  • 14
0
votes
0 answers

How to render link with css class with Sitecore Glass Mapper in the page editor?

I have the a link item and a separate title field: using (BeginRenderLink(linkWithText, x => x.LinkTitle, new { @class = "button primary"}, isEditable: Sitecore.Context.PageMode.IsPageEditor)) { @Editable(linkWithText, x => x.Title) } This…
Hans ter Wal
  • 156
  • 8
0
votes
1 answer

Sitecore MVC & Glass Mapper-Bind View Model To View

I'm just starting with Sitecore MVC & Glass Mapper. I created a Heder.cshtml view & HeaderViewModel.cs. Here's the code of the HeaderViewModel.cs file: public class HeaderViewModel : IRenderingModel { ISitecoreContext _context = new…
Vikram
  • 675
  • 6
  • 25
0
votes
1 answer

Having trouble Getting Custom attributes

I'm trying to get all attributes of each property inside a class, however I'm having trouble figuring out how to do so. I've tried a few different ways but I feel like I'm going about it wrong. Here's an example of the class and its property with…
oorosco
  • 246
  • 3
  • 14
0
votes
1 answer

Sitecore Glass create not creating correct template type

I am seeing a weird issue with the latest version of Sitecore glass and Sitecore 7.2 latest rev. I have a Foo class that has a base class of BaseItem, both wired up to Sitecore templates using glass attributes. When I use glass to insert a new item…
mluker
  • 702
  • 8
  • 26
0
votes
1 answer

Sitecore Glass Mapper - GlassHtml.RenderImage

I noticed the tutorial below using GlassHtml.RenderImage where we can specify the width and height of an image. http://glass.lu/docs/tutorial/sitecore/tutorial16/tutorial16.html <%= GlassHtml.RenderImage(Model, x => x.FeaturedImage) %> I tried to…
Nil Pun
  • 17,035
  • 39
  • 172
  • 294
0
votes
2 answers

Glass.Mapper.Sc.CastleWindsor can't apparently access classes in another assembly

We are running Sitecore 7.2 and are exploring the use of Glass.Mapper.Sc.CastleWindsor for a large project that's just getting underway. We're having problems. We have a solution with the following: 1. Base project for core reusable code 2. Base…
Iucounu
  • 1,630
  • 1
  • 20
  • 31
0
votes
1 answer

Can you cast/convert a Glass Mapper field to the corresponding Sitecore field?

We use Sitecore and TDS, and I'm just getting into trying to do some refactoring taking advantage of Glass, and am trying to figure out if there's a way to take a Glass field (e.g. a Glass.Mapper.Sc.Field.Link) and cast/convert it to the underlying…
wildwend
  • 573
  • 1
  • 5
  • 17