+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / ParentNode breadcrumb template

ParentNode breadcrumb template

6 posts, 0 answered
  1. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    20 Jun 2007
    Link to this post
    I am trying to create a template for the NodeTemplateURL property of the breadcrumb control. Does the control on the template need to be a literal or hyperlink? What does the ID need to be in order for the ParentNode to show up?

    It appears I have to create a custom template to allow for text-decoration as you have styled the ParentNode with style="text-decoration: none;" which overrides the style sheet for that node. Was there a particular reason for the inline styling in that case?
  2. Bob
    Bob avatar
    330 posts
    Registered:
    24 Sep 2012
    20 Jun 2007
    Link to this post
    Hi Ben,

    Breadcrumb control inherits from SiteMapPath and all we do is we override InitializeItem method to handle URL resolving. Also we extended the control to support external templates but the templates are not modified in any way and all the rendering is done by SiteMapPath control. So you should declare your templates as you would do for SiteMapPath. Please see MSDN documentation for SiteMapPath reference.

    Sincerely yours,
    Bob
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    20 Jun 2007
    Link to this post
    Oh that was easy...

    <asp:HyperLink runat="server" ID="parentNode" Text='<%# Eval("title") %>' NavigateUrl='<%# Eval("url") %>'></asp:HyperLink> 
  4. Charles
    Charles avatar
    14 posts
    Registered:
    25 May 2007
    28 Sep 2007
    Link to this post
    We create a Home.aspx and set it as home page, how to display as the root in the breadcrumb?

    Thanks
  5. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    29 Sep 2007
    Link to this post
    We use a RootNodeTemplateUrl. The template looks like this:

    <asp:HyperLink runat="server" ID="rootnode" NavigateUrl="~/" Text="Home"></asp:HyperLink>

    This may have changed, but I hope that helps.

    Sincerely,

    Ben
  6. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    01 Oct 2007
    Link to this post
    Hi Charles,

    Ben's code is working. Just have in mind that you need to add the full path name of the root node in the RootNodeTemplateUrl property, in the Appearance section. Also, you need to set the ShowStartingNode property in the Behavior section to True.

    Hi Ben,

    Thank you for providing the answer. Your Telerik points have been updated.

    All the best,
    Sonya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
6 posts, 0 answered