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
1 answer

Glass Mapper RenderLink link description - default text if empty

  • @if (string.IsNullOrWhiteSpace(topLinks.Target.Text)) { topLinks.Target.Text = "EMPTY DESCRIPTION"; } @(RenderLink(topLinks, x => x.Target, isEditable: true))
  • I need a way to catch it when a Content Editor has set up a…
    PeterG
    • 334
    • 5
    • 20
    0
    votes
    1 answer

    Error: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies

    I want my fields to be editable in sitecore (supports page editors). I am using MVC 4.0 and Glass Mapper to map the fields. After reading article Page Editing in MVC , I used @inherits Glass.Mapper.Sc.Web.Mvc.GlassView to get the…
    Meenakshi
    • 599
    • 3
    • 13
    0
    votes
    1 answer

    Sitecore item glasscast parameter value key null

    I'm trying to cast a Sitecore item (its in a bucket don't know if this is relevant) to a specific type: var sitecoreService = new SitecoreService("master"); sitecoreService.CreateType(userItem); The method Createtype casts a sitecore…
    Filip Huysmans
    • 1,301
    • 1
    • 20
    • 44
    0
    votes
    1 answer

    Type has not been loaded

    Following question, I have installed Glass.mapper.sc.Mvc in my MVC project and followed following steps Created a class called "Home" [SitecoreType(AutoMap = true)] public class Home : IPageBase { public virtual string PageTitle …
    Meenakshi
    • 599
    • 3
    • 13
    0
    votes
    1 answer

    Sitecore Glass mapper with web API

    I'm getting the following error only on live server, while calling function using WebApi, I'm using Sitecore glass mapper. { "$id": "1", "Message": "An error has occurred.", "ExceptionMessage": "The 'ObjectContent`1' type failed to…
    Ayman Barhoum
    • 1,255
    • 1
    • 16
    • 31
    0
    votes
    1 answer

    Disable editing on text field in Sitecore page editor

    I'm using SiteCore 7 MVC and Glassmapper. I have a set of samples which are rendered using razor and set as standard values when an Author/Editor creates a new page. I wish to prevent the editor from modifying these samples in the PageEditor. I…
    0
    votes
    2 answers

    Sitecore Glass Mapper ObjectToSwitchTo null reference in page editor

    I have the following structure as Template in visual studio : Under a page, i have one or more link root [SitecoreType(TemplateId = "{4AAA9A10-36C2-484F-A648-2BEF349F0052}", AutoMap = true)] public class LinkRoot : IBaseTemplate { …
    JobiJoba
    • 73
    • 2
    • 7
    0
    votes
    0 answers

    Using Glass Mapper's @inherits GlassView with MVC 5.0 views

    I recently updated my solution to MVC 5 and I am facing the following issue. It appears as though I can no longer format the code in any of my Views that utilize @inherits GlassView. By format, I mean auto-formatting using the CTRL + K + D key…
    Derek Hunziker
    • 12,996
    • 4
    • 57
    • 105
    0
    votes
    2 answers

    How to render field in PageEditor when using Template inheritance with Sitecore Glass Mapper

    I have the following setup in my solution, described in an earlier post: How to implement Sitecore Template inheritance with Glass Mapper I'm able to display the content of inherited fields now. However when I try to edit them in the page editor…
    5earch
    • 289
    • 2
    • 4
    • 15
    0
    votes
    2 answers

    Glass Mapper not loading Model for View Rendering in Staging Area

    Using Sitecore 6.6 and Glass 3.0 I've made a MVC layout which uses a View Rendering via Glass. I'm trying to show Highlights. I've made a View Rendering named GlassHighlights which has the following fields set: Path:…
    Joost Bollen
    • 90
    • 2
    • 10
    0
    votes
    1 answer

    Glass.Mapper and creating Sitecore items using Interfaces

    This was a question from Twitter: What is the pattern for creating items from interface models? Using sitecoreService.Create(T newItem, K parent) where T is an interface, requires adding a class to create new items. Is there a way to create…
    Michael Edwards
    • 6,308
    • 6
    • 44
    • 75
    0
    votes
    1 answer

    MissingMethodException: Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)'

    I am getting missing method exception in Sitecore while using Glass mapper. This is working in Sitecore 7 project but when I tried to use same in Sitecore 6.6 project it fails. I am not getting that how to find what is the problem in underlying…
    Harsh Baid
    • 7,199
    • 5
    • 48
    • 92
    0
    votes
    1 answer

    Glass mapper v2 how to fallback to default language

    I am using glass mapper v2 in my project. Glass Mapper working great, but in case I added new language to site, glass mapper can't read a lot of properties and I am getting Null Reference errors. I would like to have glass mapper behavior like read…
    Arbejdsglæde
    • 13,670
    • 26
    • 78
    • 144
    -1
    votes
    1 answer

    Issue in Accessing Data from Sitecore using Glass Mapper

    I have items with children in content tree as below and has to be shown in the same page. We have created a Stronglytyped View of type ModelA for the page: public class ModelA { public IEnumerable item1 { get; set; } public…
    Suhas
    • 417
    • 1
    • 5
    • 18
    -2
    votes
    1 answer

    The model item passed into the dictionary is of type 'Sitecore.Mvc.Presentation.RenderingModel', but this dictionary requires a model item of type

    I am using Glass.Mapper.sc ... @inherits Glass.Mapper.Sc.Web.Mvc.GlassView in sitecore Layout... Not Controller/View Rendering Any idea why this is not working?
    luckymow8
    • 72
    • 3
    1 2 3
    20
    21