No longer able to get Page Description - Bugs & Issues - Bugs & Issues - Progress Community
 Bugs & Issues

No longer able to get Page Description

  • No longer able to get Page Description
  • Before upgrading to 4.2 I was able to get the page description using the following code, now whatever I try the description is always just an empty string. Any ideas?
    protected void Repeater_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        SiteMapNode cNode = e.Item.DataItem as SiteMapNode;
        PageNode node = (PageNode)cNode;
        string desc = node.Description // this is now always empty, but used to work

    The above is code behind for a simple repeater that was bound to asp:SiteMapDataSource but I get the same problem when using the new SitefinitySiteMapDataSource.

    Thanks in advance,
  • Hi Phill Hodgkinson,

    Can you please make sure that you are working with the Description property of the PageData object, not the PageNode? I have just tested the described functionality and it seems to be working fine. PLease take a look at the below sample code:
    var myPage = App.WorkWith()
                                .Where(p =>p.Page != null && p.Page.Title == "Home")
                var descr = myPage.Page.Description;
    which will return the content of the Description property for my "Home" page.

    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Hi Boyan,

    I will give your sample code a try. I do wonder if this is the most efficient way to get page description since I have to make this call OnDataItemBound for each item in the menu. Also, part of the reason that I posted this issue was that using PageSiteNode worked before upgrading to 4.2 and then it just stopped working (aka another undocumented breaking change).

    I'll let you know if the below works for me but again I fear it's not a very efficient way to get a page description.

  • Hi Boyan,

    So your solution doesn't work for me, the page Description always returns as an empty string. I was able to get things to work using the Page manager. The following code works for me, but again I find it strange that I have to do this every time a menu node renders and that there are so many references to page description (i.e. PageSiteNode) but they're always empty. 

    ISitefinitySiteMapNode smNode = e.Item.DataItem as ISitefinitySiteMapNode;
    var pageNode = smNode as PageSiteNode;
    var pManager = Telerik.Sitefinity.Modules.Pages.PageManager.GetManager();
    PageData page = pManager.GetPageData(pageNode.PageId);
    string desc = page.Description;

    I'd still like to know what the optimal solution is or if this is indeed it.

  • Getting similar error with the following code.  This use to work in 4.1 but no longer does in 4.2.  See the "Eval("Description")" line below.

    <%@ Control Language="C#" AutoEventWireup="true" %>
    <telerik:RadTabStrip ID="RadPanelpageNav" runat="server" Visible="false" />
    <asp:Repeater  ID="Repeater1" runat="server" DataSourceID="SiteMapDataSource" >
            <ul class="page-nav-holder">
                    <a href='<%# Eval("Url") %>' runat='server'>
                        <h3><%# Eval("Title") %></h3>
                        <p><%# Eval("Description") %></p>
    <asp:SiteMapDataSource runat="server" ID="SiteMapDataSource" StartingNodeOffset="0" ShowStartingNode="false" />
  • Hi,

    you can test this :
    SiteMapNode cNode = e.Item.DataItem as SiteMapNode;
    PageNode node = (PageNode)cNode;
    string desc = node.GetString("Description");

  • I have the same issue!
    We are using SF 5.0.2500.0
  • You can try this:
    var des = page.GetPageData().Description
    // The statement "page.Description" always returns as an empty string. I don't know why
    This work for me