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

Forums / Suggestions / How to show breadcrumbs in Search Results

How to show breadcrumbs in Search Results

17 posts, 0 answered
  1. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    16 Apr 2008
    Link to this post
    I need to know how to show URLs this way

    Search for: Dubai

    Results
    UAE / Emirates / Dubai

    Is there a way to do this?

    (please reply asap)

    Thanks
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    21 Apr 2008
    Link to this post
    Hi Zubair,

    You could add a breadcrumb control in your pages this way :
    <sfWeb:Breadcrumb></sfWeb:Breadcrumb> 
    Then, using the PathSeparator property, change the separator to :"/". We haven't tried such scenario but you can try adding it to the Searchresults.ascx template.
    The breadcrumb control uses a SiteMap as a data source. You can find more about it and the way you can style your control here.

    The way your URLs look depends on several things :
    • The page structure of your web sites - page groups, subpages, etc;
    • The URL rewritting rules, if you have any.
    Basically, if you have page structure like this :
    UAE 
     |___Emirates 
             |______Dubai 
    If Dubai is indexed, you should see your URLs with results something like UAE/Emirates/Dubai.aspx

    The other way to make your URLs more user-friendly is to use the built-in URL Rewriter. Please refer to the Sitefinity User Manual > Application's web.config file, section URL Rewriting.

    All the best,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    21 Apr 2008
    Link to this post
    The link for Breadcrumb is dead.
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    21 Apr 2008
    Link to this post
    Hi Zubair,

    Sorry for the inconvenience. Here's the correct link:
    Breadcrumb

    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    21 Apr 2008
    Link to this post
    Thanks for the link, I'm still not sure how to set the Sitemap as a datasource of the breadcrumb control and pick the current document's path.

    Can you please provide a solution. Thanks
  6. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    21 Apr 2008
    Link to this post
    Thanks for the link, I'm still not sure how to set the Sitemap as a datasource of the breadcrumb control and pick the current document's path.

    Can you please provide a solution. Thanks
  7. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    29 Apr 2008
    Link to this post
    Hi Zubair,

    You could simply insert :
    <sfWeb:Breadcrumb runat="server" ID="Breadcrumb1"></sfWeb:Breadcrumb> 
    in your template. It is our implementation, and if you don't specify a SiteMap provider, then you are using the default Sitefinity provider.

    In SearchResult.ascx you have to use custom Sitemap to use with the Breadcrumb control, so that the Breadcrumb can display the path to the result page, which is based on the items' URL or Title. You should check which page belongs to the result URL or Page.


    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    29 Apr 2008
    Link to this post
    I'm sorry but your solution doesn't make sense to me, I'll appreciate if you could provide the SearchResult control with breadcrumbs.

    Thanks
  9. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    03 May 2008
    Link to this post
    Hi Zubair,

    We are enhancing the SearchResult control as well as the ResultItem class which provides the data for each result inside of a SearchResult. I have logged this as a feature request.

    Thank you for bringing this up. It is a common UI element among search results and it would make sense if our SearchResults control can display it out of box as well.

    All the best,
    Ivan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    04 May 2008
    Link to this post

    That's great, thanks.

    So when should I expect it ? part of SP2 ? When is it releasing ?

  11. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    07 May 2008
    Link to this post
    Hi Zubair,

    Most probably it will not be implemented in SP2 as the tasks for the service pack have already been scheduled. The release will be available by the end of this month.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  12. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    07 May 2008
    Link to this post
    That's sad, in the meantime can you please send me a solution for this.
  13. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    20 May 2008
    Link to this post
    Hello Zubair,

    Changing the Starting node of the BreadCrumb, as well as for the SiteMapPath turned out to be more tricky than I thought. This is due to the fact that the two controls are almost the same and they are not able to work with SiteMapDataSource. We can only set a starting node on SiteMapDataSource unfortunately.
    What we can do is "Hack the SiteMapPath" so it can use SiteMapDataSource. This is one approach to the problem, another one could be to build your own breadcrumb control. So here is what you could do:
    1. Create a Custom User Control, and drop a SiteMapDataSource control. You can find it in the Visual Studio control toolbox.
    2. In the code behind and Page_Load event:

    string resolvedUrl = Telerik.Web.UrlPath.ResolveUrl("~/resultUrl.aspx"); 
    SiteMapNode currentNode = SiteMap.Provider.FindSiteMapNode(resolvedUrl); 
    SiteMapDataSource1.StartingNodeUrl = currentNode;     
     

    You have the node of the resultUrl, where resultUrl.aspx is an URL of the current result. From now on, you could iterate through all currentNode.parentNode-s, until you reach the root node and this is your path. For every Node you are adding a link and between the links, you have the separator character.

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  14. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    16 Jun 2008
    Link to this post
    what is the script to register the TagPrefix for the control: <sfWeb:Breadcrumb runat="server" ID="Breadcrumb1"></sfWeb:Breadcrumb> 
  15. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    16 Jun 2008
    Link to this post
    oop never mind answered my own question:

    <%@ Register TagPrefix="sfweb" Namespace="Telerik.Cms.Web.UI" %>

  16. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    16 Jun 2008
    Link to this post
    k nevermind that code above got it to display in the designer but it throws an error when I try to build or view the page that the server tag is unknown, please help thanks!
  17. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    16 Jun 2008
    Link to this post
    lol okay i got it, forgot to add the assembly:

    <%@ Register TagPrefix="sfweb" Namespace="Telerik.Cms.Web.UI" Assembly="Telerik.Cms.Web.UI" %>


    works! thanks
Register for webinar
17 posts, 0 answered