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

Forums / General Discussions / dynamic menu without radcontrol,

dynamic menu without radcontrol,

4 posts, 0 answered
  1. CMSGuru
    CMSGuru avatar
    42 posts
    Registered:
    15 Feb 2011
    25 Mar 2011
    Link to this post
    I have a requirement to build a custom menu other then what the "out of the box" nav controls can do and I dont' want to use the rad menu control if I can help it, so how can I build my menu so its gets the pages that have
    showinnavigation = true and published = true?

    So far I'm able to get other content items out of the database to custom my layouts, so is it possible to get pages and they're correct URLs also?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    30 Mar 2011
    Link to this post
    Hello NewToCMS,

    Here is the API that you can use to get all Navigable and Published pages. Then you can populate the menu you have with the data returned by the query

    var manager = new CmsManager();
    var pages = manager.GetPages();
    var query = pages.Cast<ICmsPage>().Where(p => p.Navigable = true && p.Status == PageStatus.Published);

    All the best,
    Ivan Dimitrov
    the Telerik team
  3. CMSGuru
    CMSGuru avatar
    42 posts
    Registered:
    15 Feb 2011
    30 Mar 2011
    Link to this post
    we also, have page groups, can I pull them out with all of the pages associated to that group as well or just the pages?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    31 Mar 2011
    Link to this post
    Hi NewToCMS,

    The ICmsPage has  a property PageType which you can use to identify whether the page is group or not. Then you can operate with the child pages.

    All the best,
    Ivan Dimitrov
    the Telerik team
Register for webinar
4 posts, 0 answered