Custom Routing

3 posts, 0 answers
  1. Kwena
    Kwena avatar
    2 posts
    Member since:
    Oct 2010

    Posted 06 Jul 2012 Link to this post


    i have a problem, i recently found a solution to add my custom routes into Sitefinity tables.
    my route url is like this ("Catalogue/{category}").

    My problem is now my main menu treats the "catalogue" as a sub category in the link e.g. i have a news menu item which is supposed to redirect me to, but instead i get here, and that doesn't exist.

    is there a way to force sitefinity menu to resolve urls to read from root?


  2. Stanislav Velikov
    Stanislav Velikov avatar
    4 posts

    Posted 11 Jul 2012 Link to this post


    The navigation control in Sitefinity reads from SitefinitySiteMap which is an extended SiteMap control and as the roue was modified now I suppose if this is happening for it will happen for all pages created under the root (they will have
    A temporary workaround can be to add the ~//Catalogue/url as additional url for news items.
    If you can share with me the routing logic used to get the catalogue added to the route so I can get better idea or the routing.

    Kind regards,
    Stanislav Velikov
    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
  3. Kwena
    Kwena avatar
    2 posts
    Member since:
    Oct 2010

    Posted 11 Jul 2012 Link to this post

    Hi Stanislav 

    Thanks for the reply.

    for now what i did was override the SiteMenu in C# and gave them absolute urls e.g. (
    smMainMenu.FindItemByText( "News" ).NavigateUrl = "//";)

    but here is how i added my custom routing in the Global.asax.


    Telerik.Sitefinity.Abstractions.Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>( Bootstrapper_Initialized );
     Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs args)     {         if (args.CommandName == "RegisterRoutes")         {              var routes = (System.Web.Routing.RouteCollection)args.Data;  routes.Add( "RTCategory"new System.Web.Routing.Route"catalogue/{category}"new CatalogueRouteHandler() ) );  routes.Add( "RTProduct"new System.Web.Routing.Route"catalogue/{category}/{product}"new CatalogueRouteHandler() ) );  routes.Add( "RTManufacturer"new System.Web.Routing.Route"manufacturers/{manufacturer}"new CatalogueRouteHandler() ) ); } }
Back to Top