Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Suggestions > lists 'open in new page' view

lists 'open in new page' view

  • Posted on Oct 20, 2008 (permalink)

    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!

    Reply

  • Pepi Pepi admin's avatar

    Posted on Oct 21, 2008 (permalink)

    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.

    Reply

  • jkregala Intermediate avatar

    Posted on Jun 23, 2010 (permalink)

    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 :)

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Jun 24, 2010 (permalink)

    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

    Reply

  • NK avatar

    Posted on Jul 20, 2010 (permalink)


    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.



    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Jul 20, 2010 (permalink)

    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

    Reply

  • NK avatar

    Posted on Jul 20, 2010 (permalink)


    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,

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Jul 20, 2010 (permalink)

    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

    Reply

  • bleutiger Intermediate avatar

    Posted on Oct 13, 2010 (permalink)

    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?

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Oct 13, 2010 (permalink)

    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

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Suggestions > lists 'open in new page' view