Posts

Showing posts with the label Sitecore Glass mapper

Sitecore Glass mapper ReferenceField (DropLink)

Image
   Introduction: In this post we will see how we can leverage ORM concept in Sitecore as well. We will start with simple project and introduce Glass mapper. Reference Field will be our main focus in the post.  Background: We have updated sitecore Home Page with our Layout and Controller Rendering. Given below is the pictorial view. Layout : Under Layout Section in Content Editor fig-1 Create a mvc Layout. My layout just contain a Place holder as shown below fig-2 for this post we will just be using Static place holder i.e "smain" Rendering: We will be creating a rendering and data source for the same. Under Feature folder create new rendering folder -> than create Controller Rendering. The Controller field will contain , Name Space + Controller Class and with comma separated, we mention which dll contain this class. Action contains Method to hit in the Controller. fig-3 Add the layout and rendering to Home Item as shown below. By This time I hope we all know how to add...

Sitecore Glass Mapper Editable fields.

Image
   Introduction: In our previous post we had seen how we can make  make Fields Editable in Experience Editor using " @Html.Sitecore().Fields ". But usually as the project Grows in Size we tend to use some ORM to help us get mapping task out of the box. Thus, in the section we will be Discussing how we can make the Fields Editable in Experience Editor while using Glass mapper. Implementation: We will continue to update our previous Application. The application already contains a Controller Rendering, that will be using Sitecore Helpers to make field Editable. Again as I said in previous blog, the change is right from Architecture point. Depending on how we want to target the View (Sitecore, Glass Mapper, or plain) will decide how to write the Model, Business logic, Data Fetching logic to showing view. Thus, here we will not manipulate the existing logic. We will create another Controller Rendering that will be using Glass mapper to make fields Editable in Experience Editor...