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

Forums / Developing with Sitefinity / Show What Pages Include a List?

Show What Pages Include a List?

4 posts, 0 answered
  1. Aaron
    Aaron avatar
    24 posts
    Registered:
    15 Feb 2008
    14 Jan 2009
    Link to this post
    I am using the Lists module for a number of different lists in my website.  For example, I have a list called "Agency List".  I have included this list on a number of different pages but don't remember which ones.  Is there a way for me to get a list of all of the pages that have the "Agency List" list included on it?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    15 Jan 2009
    Link to this post
    Hello Christopher,

    Thank you for using our services.

    Use the code below in a user control. It will return all pages where you have ListsDisplay control

    CmsPageBase page = this.Page as CmsPageBase; 
    IList<ICmsPage> list = page.GetPagesByControlType(typeof(Telerik.Lists.WebControls.ListDisplay)); 
    foreach (ICmsPage p in list) 
        Response.Write(p.Name + "<br/>"); 
     

    I hope this helps.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Aaron
    Aaron avatar
    24 posts
    Registered:
    15 Feb 2008
    15 Jan 2009
    Link to this post
    Thanks for your reply.  I was able to get it to work, however it only lists the pages.  Is there a way for it to list what "List" is on each of the pages?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    16 Jan 2009
    Link to this post
    Hello Christopher,

    There is a way to get the pages with specified Lists, let's say "My_List". In this case you need to read the ListDisplay control properties. Probably, I will come up with this solution in my blog at http://blogs.sitefinity.com/

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
4 posts, 0 answered