Is it possible to use the Sitefinity breadcrumb in a widget

Posted by Community Admin on 04-Aug-2018 15:35

Is it possible to use the Sitefinity breadcrumb in a widget template?

All Replies

Posted by Community Admin on 19-Dec-2012 00:00

I created a module where I want to have the full detail page view show up dynamically versus selecting another existing page.  I would like to add an easy way for users to get back to the list view page so have been trying to get a breadcrumb to work, but I am not seeing anything output.

In my widget template for the full details I have added:

<sf:RadBreadCrumb id="RadBreadCrumb" runat="server" />

There are no errors and the details view pages comes up fine, but I do not get a bread crumb trail.  Is this possible to use in widgets?  Do I need to add a sitemap source to the widget too?

If I have to I can just create a child page under the listing page and drop a breadcrumb widget onto the page and then have the details view target this page versus the dynamically generated one, but I am trying to avoid this.

Posted by Community Admin on 19-Feb-2013 00:00

Did you ever get this figured out? I am trying to do something similar and am not able to get the breadcrumbs working in my widget template.

Just wondering if anyone else has gotten this to work?

Posted by Community Admin on 22-Feb-2013 00:00

Hi,

RadBreadCrumb
is used inside Sitefinity, it is not used for the front end. You are not able to use the control in a template.

What we could suggest you is to inherit from Breadcrumb and override the LayoutTemplatePath. For instance:

namespace SitefinityWebApp
    public partial class WebUserControl : Breadcrumb
    
  
  
        public override string LayoutTemplatePath
        
            get
            
  
                return WebUserControl.layoutTemplatePath;
  
            
            set
            
                base.LayoutTemplatePath = value;
            
        
  
        public static readonly string layoutTemplatePath = "~/SitefinityWebApp.Breadcrumb.ascx";
    

Please note that your custom template should contains these elements:
<%@ Register Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
 
<div class="sfBreadcrumbWrp">
    <sf:SitefinityLabel id="BreadcrumbLabel" runat="server" WrapperTagName="span" HideIfNoText="true" CssClass="sfBreadcrumbLabel" />
    <telerik:RadSiteMap runat="server" ID="Breadcrumb" Skin="Sitefinity">
        <DefaultLevelSettings ListLayout-RepeatDirection="Horizontal" Layout="Flow"/>
    </telerik:RadSiteMap>
</div>

Then implement your logic in the code behind and the template.

Regards,
Stefani Tacheva
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed