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

Forums / Suggestions / lists 'open in new page' view

lists 'open in new page' view

10 posts, 0 answered
  1. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    20 Oct 2008
    Link to this post
    i don't know if lists are moving to generic content or not but i think it would really be helpful if there was a built-in option to have list items open in their own separate window. I'm wanting to make a dropdown menu with all the list items, then navigate to that items individual page when selected, along with a list item to view the full page of list items in a separate page.

    can this already be done or am I missing something... I can probably code it manually but I want to make sure i'm not duplicating built-in functionality (again!) because I didn't know where to find it.

    thanks!
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    21 Oct 2008
    Link to this post
    Hello Josh,

    Lists module is not a Generic Content based module and does not provide the required functionality out of the box. So you should create your own control that implements IListDisplay interface. For details please refer to the Lists module API.

    Also, you could investigate Page List mode of the Lists public control as it is close to the functionality you are looking for.

    Do let us know if you need any further assistance.

    Kind regards,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    24 Jun 2010
    Link to this post
    The current "open in new page" functionality for the Lists control simply "simulates" arriving onto a new page, but in actuality you're still on the same page. So that means if there are other lists within a page, clicking on a list item belonging to another list means the other lists would remain on the page, so it does not really feel like the user is taken to a "new" page.

    So I guess a new control yet again huh? Thanks :)
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Jun 2010
    Link to this post
    Hello jkregala,

    Yes you are still on the same page, because we use the data is passed to the QueryString and then read from there. You need a custom control that gets only a single item based on a QueryString value passed. The QueryString value should be the ID of the IList item.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. NK
    NK avatar
    82 posts
    Registered:
    15 Apr 2010
    20 Jul 2010
    Link to this post

    Hello again Ivan,
    I ran into the same problem as jkregala. And as you said "You need a custom control that gets only a single item based on a.....". Would you guide me thru those steps, which images and coding would be great.
     
    I am a newbie of most the functions of Sitefinity.


    Thanks you very very much all you help today.



  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    20 Jul 2010
    Link to this post
    Hi NK,

    Create a custom control that inherits from ListDisplay. Then override PageLists_ItemCreated and implement a custom method that will show a single item based on the ID of a single item in the QueryString

    sample

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Telerik.Lists.WebControls;
    using Telerik.Lists;
    using System.Web.UI;
       
    /// <summary>
    /// Summary description for ListsDisplayCustom
    /// </summary>
    public class ListsDisplayCustom :ListDisplay
    {
        public ListsDisplayCustom()
        {
            //
            // TODO: Add constructor logic here
            //
        }
       
        protected override void PageLists_ItemCreated(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
       
            if (!String.IsNullOrEmpty(Context.Request.QueryString["item"]))
            {
                var qs = Context.Request.QueryString["item"];
                ShowSingleItem(qs);
       
            }
            else
            {
                base.PageLists_ItemCreated(sender, e);
            }
        }
       
        public virtual void ShowSingleItem(string id)
        {
            IListItem listItem = (IListItem)this.Manager.GetListItem(new Guid(id));
            if (this.PageListContainer.Headline != null)
            {
                ((Control)this.PageListContainer.Headline).Visible = true;
                this.PageListContainer.Headline.Text = listItem.Headline;
            }
       
            if (this.PageListContainer.Content != null)
            {
                ((Control)this.PageListContainer.Content).Visible = true;
                this.PageListContainer.Content.Text = "" // get the list item content here
            }
       
            if (this.PageListContainer.BackToAllItemsButton != null)
                ((Control)this.PageListContainer.BackToAllItemsButton).Visible = true;
       
            this.PageListContainer.Lists.Visible = false;
        }
    }

    You have to add a ToolboxItem for the control and override PageListTemplatePath to set the path to your template.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. NK
    NK avatar
    82 posts
    Registered:
    15 Apr 2010
    20 Jul 2010
    Link to this post

    Hi Ivan,

    Thank you for your responses.

    I followed your instruction that I created custom control and pasted your code in then I got an error when I compiled it. The error it said

    'ASP.listsdisplaycustom_ascx.FrameworkInitialize()': no suitable method found to override

    Here what I did: the code behind of custom control ListsDisplayCustom.ascx
     
     ...
     using Telerik.Lists;
     using Telerik.Lists.WebControls;

     public partial class ListsDisplayCustom : ListDisplay
     {
          protected void Page_Load(object sender, EventArgs e) { }

          public devusercontrols_ListsDisplayCustom()
          {
              // TODO: Add constructor logic here
          }
          ...


    Please help!!


    Thanks,

  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    20 Jul 2010
    Link to this post
    Hi NK,

    This is a custom control that inherits from ListDisplay. It is not a user control.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    13 Oct 2010
    Link to this post
    Can you explain the last comment in this post.

    If we don't put your code in a user control where do we put it?

  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    13 Oct 2010
    Link to this post
    Hello bleutiger,

    You can put it in App_Code or create a class library and compile it.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
10 posts, 0 answered