Skip to Content
Sitecore Cookbook for Developers
book

Sitecore Cookbook for Developers

by Yogesh Patel, Patel Y Sunderbhai
April 2016
Beginner content levelBeginner
338 pages
7h 38m
English
Packt Publishing
Content preview from Sitecore Cookbook for Developers

Creating breadcrumb using the view and custom model

In the previous recipe, you learned creating a simple menu using a view with the default RenderingModel. In this recipe, we will create breadcrumb using a view and custom model.

Getting ready

For this recipe, we will use the same layout and items created in the previous recipes.

How to do it…

We will first create two classes: a simple BreadcrumbItem and BreadcrumbList. Here, BreadcrumbList will contain a list of BreadcrumbItem objects.

  1. In the SitecoreCookbook project, create a BreadcrumbItem class in the Models folder. This class will contain properties useful to render breadcrumb items. We inherited this class from Sitecore.Data.Items.CustomItem to implement custom items:
    public class BreadcrumbItem ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Azure for Developers

Hands-On Azure for Developers

Kamil Mrzygłód

Publisher Resources

ISBN: 9781784396527Supplemental Content