Set virtual nodes in the Breadcrumb widget

The IBreadcrumExtender interface allows you to add additional nodes at the end of the current sitemap path through the widgets on the page. The scenario that it is implemented for is to display the Title of the content item that is loaded in DetailsMode in the ContentView widget, as a part of the breadcrumb. You can use it in any custom control, in order to add additional nodes to the current sitemap path. When used in custom widgets, the widget must register an object of type IBreadcrumbExtender in the current page using RegisterBreadcrumbExtender extension method declared in the Telerik.Sitefinity.Web namespace.

NOTE: To see the virtual nodes in the breadcrumb widget, you must set its AllowVirtualNodes property to true. For more information about the Breadcrumb widget, read Breadcrumb widget.

To extend your custom control with this functionality, you must perform the following:

  1. Implement the IBreadcrumExtender interface.
    The interface can be found in the Telerik.Sitefinity.Web namespace.
  2. Implement the GetVirtualNodes method.
    The GetVirtualNodes method returns the virtual nodes that you want to append to the sitemap path. To create them, you must perform the following:
    1. Create an empty list.
      Create a List of SiteMapNode objects.
    2. Create a sitemap node.
      Create an instance of the SiteMapNode class.
    3. Add the node to the list.
      Add the instance of the SiteMapNode to the list that was created in step 1.
    4. Return the list.
      Return the list of sitemap nodes.
  3. Override the OnPreRender method of your widget.
    In the override, call the RegisterBreadcrumbExtender method of the System.Web.UI.Page instance and pass the instance of your widget as an argument.

Use the following code sample of IBreadcrumExtender implementation:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?