More in this section

Forums / Developing with Sitefinity / How to make a Page group page to redirect other page?

How to make a Page group page to redirect other page?

3 posts, 0 answered
  1. rent
    rent avatar
    104 posts
    Registered:
    05 May 2008
    15 Jun 2009
    Link to this post

    Hello all!!!

    Standard implementation of pages does not allow Page group to redirect to own page itsredirects to its first sub-page only.

    I want to create a Page group named "News" and when clicking in menu redirect to News.aspx page that contain news for all categories. And this Page group "News" have a child pages - news by category: Industrial news, Political news, Sport news... and in menu by clicking child elements to view selected news category...

    How to fix this?

    Thanks.

  2. rent
    rent avatar
    104 posts
    Registered:
    05 May 2008
    15 Jun 2009
    Link to this post

    And question two:

    How to change visual appereance of Site menu control? Where CSS file to change it?

  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    15 Jun 2009
    Link to this post
    Hi rent,

    1. Standard implementation of pages does not allow Page group to redirect to own page itsredirects to its first sub-page only.....

    There are two options:

    1. Create a custom logic in RadMenu_ItemDataBound event and change the group page redirect - for example you want to redirect to the second page not to the first one.

        public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e) 
        { 
            CmsSiteMapNode groupNode = e.Item.DataItem as CmsSiteMapNode; 
            if (groupNode != null && groupNode.PageType == CmsPageType.Group) 
            { 
     
                CmsManager man = new CmsManager(); 
                ICmsPage page = man.GetPage(groupNode.PageID) as ICmsPage; 
                groupNode.Url = ((ICmsPage)page.Pages[1]).DefaultUrl.Url;           
            } 


    2. Hardcode the links where you want to be redirected after clicking the group page.


    CmsManager man = new CmsManager(); 
    ICmsPage page = man.GetPage(groupNode.PageID) as ICmsPage; 
    groupNode.Url = "http://www.yahoo.com";      


    For the menu styling you can add css classes directly in the control declaration or you can create a custom skin.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
3 posts, 0 answered