-
Book Overview & Buying
-
Table Of Contents
Sitecore Cookbook for Developers
By :
Sitecore provides you with different component properties such as data sources, rendering parameters, and so on. By default, the context item becomes data source for the component. By passing data source, we can change the behavior.
In this recipe, we will create a rendering to list products on the products' landing page. We will reuse the rendering on the home page to show a limited number of products with a different look and feel.
In the first chapter, we created the Product Category and Product templates having Common Fields as a base template, which contains fields such as the title, body, and image. Make sure that you created multiple product categories and products inside it.
First, we will create a model to list Sitecore items:
SitecoreCookbook project, create an ItemList model in the Models folder with properties as follows:public class ItemList : RenderingModel
{
public List<Item...