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

Forums / General Discussions / Page Manager and Generic Content Issues

Page Manager and Generic Content Issues

6 posts, 0 answered
  1. Ann
    Ann avatar
    16 posts
    Registered:
    25 Aug 2010
    25 Aug 2010
    Link to this post

    We are currently developing with the new Sitefinity 4.0 Beta.  It seems very thorough, and we are looking forward to future releases.  We have some questions about certain issues that we’ve run into while trying to use generic content, as well as the page manager.

    1.  Regarding the pages, we are having some trouble changing the order in which the pages appear in the menu.  Using the UI, we have tried to move a page up or down in relation to the other pages, but when the site is previewed or edited, the page goes back to its old position.  Is there any sort of Save functionality that perhaps we are missing?  Or do you anticipate this coming in a future release? 

    Also, does the Beta support any breadcrumb functionality?  We were having a hard time finding it in the API to create our own customized control, since it appears that a breadcrumb nav widget does not come with the existing controls.

     

    2.  As for generic content, we are creating a custom widget that populates with generic content that has a specific tag.  However, we have noticed that when we create a generic content block using the UI, the same content is created twice with unique GUIDs.  To clarify, when we perform a “get” on all content using the API, we receive two copies each of the content we’ve created, each with their own GUID.  For now, we are just programmatically de-duplicating our list of content.  We weren’t sure if you were aware that this duplication is taking place, or if there is a fix planned. 

    Lastly, we want our custom widget to link to the generic content items.  We tried using the URL in the content object, but these urls don’t seem to point to an actual location.  Is there a url pointing to each content item that will display a default or generic page with the content?

    I know that the taxonomy system is still a work in progress, but we were just curious how this might be implemented in future releases.  We would really like to see a function on the content manager that queries based on taxons, such as GetContentByTaxon(Taxon or TaxonList).  Let me know if you can address any of these questions. Thank you for your time and help.

    Thank you,
    Ann

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    26 Aug 2010
    Link to this post
    Hello Ann,

    Thank you for using our services.

    Let me try to address the above queries in my response.

    1) We are aware of such issues when reordering pages and are going to resolve them in our next releases of the system. Unfortunately the breadcrumb control is not yet part of the release, however this one is a must. You can create a custom breadcrumb control using the Pages API. The bellow code gets your current page:
    SiteMapNode currentNode = SiteMapBase.GetCurrentProvider().CurrentNode;
    PageSiteNode node = (PageSiteNode)currentNode;
    var page = App.WorkWith().Pages().Where(p => p.UrlName == node.UrlName).Get().First();

    Then you can get the page's parent, until you reach the sitemap root node and construct a bread crumb. However here you can work only with SiteMapNode and get its url and parent - no need to get the page.

    2) What you are experiencing is that the Content Block is creating another instance of content. By default the Content Block should create stand alone content items and not share them in Generic Content module unless you choose to share the content. The behavior will be similar as in Sitefintiy 3.x and Generic Content control. The Content Block control however is not fully implemented and is still missing the functionality for selecting shared content or sharing content.

    Furthermore when you use Fluent API you should get content item by its status. Since our content items have life cycle and different stages you should be getting only published ones (this is why you receive two instances for two items).

    When you are getting content items by them selves cannot be displayed. You need a control such as News View, Content Items List placed on a page and then you append the content item's url to this page's url and you will be able to link to the item. Bellow is some sample code to help you achieve this:
    using System;
    using System.Linq;
    using System.Web;
    using Telerik.Sitefinity;
    using Telerik.Sitefinity.Modules.Pages;
     
    namespace SitefinityWebApp
    {
        public partial class TestPage : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
               var contentPage = App.WorkWith()
                                    .Pages()
                                    .LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend)
                                    .Where(p => p.Title == "content items")
                                    .Get().First();
                var pageUrl = contentPage.GetFullUrl();
                 
                App.WorkWith()
                .ContentItems()
                .Where(c => c.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live)
                .ForEach(c =>
                {
                    var cntUrl = c.Urls.FirstOrDefault();
                    Response.Write("<a href=\""+VirtualPathUtility.ToAbsolute(pageUrl+cntUrl.Url)+"\">"+c.Title+"</a>");
                    Response.Write("<br />");
                });
            }
        }
    }

    As you may notice I am looking for a page with particular title - this page contains a content view control which will display my generic content item when the link generated is clicked.

    Kind regards,
    Radoslav Georgiev
    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
  3. Rich
    Rich avatar
    27 posts
    Registered:
    20 Feb 2010
    13 Nov 2010
    Link to this post
    In the Sitefinity 4.0 RC, is there functionality for a crumbtrail or do we still have to create a custom control to accomplish it?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    13 Nov 2010
    Link to this post
    Hello Rich,

    Adding the BreadCrumb control is in our to do list, but we will not have it for the beta. You can use Menu / Show Path And BreadCrumb scenario or using the ASP.NET SiteMapPath control

    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
  5. Pavliks
    Pavliks avatar
    68 posts
    Registered:
    06 Apr 2010
    26 Jan 2011
    Link to this post
    Hi Radoslav,

    I'm trying to get the URL of the default blog page set when you create a new blog, this is what I have:

    PageNode blogPage = App.WorkWith().Pages().Where(page => page.Id == blogPost.Parent.DefaultPageId && page.Page.Status == ContentLifecycleStatus.Live).Get().First();
      
    string sURL = blogPage.Urls[0].ToString();

    I'm getting the page returned but it has no URLs and is missing the "GetFullUrl()" method you are referencing. Am I using the wrong object?

    Thanks,
    Steve
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    31 Jan 2011
    Link to this post
    Hello,

    GetFullUrl is a static method of  Telerik.Sitefinity.Modules.Pages.PageExtesnsions

    Kind 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
6 posts, 0 answered