PageNode.Urls is empty

Posted by Community Admin on 04-Aug-2018 16:44

PageNode.Urls is empty

All Replies

Posted by Community Admin on 25-May-2012 00:00

Using the Fluent API in Sitefinity 5.0 SP1, I'm just trying to get the url for a page to put in the href attribute of a link. I have a collection of PageNodes and I'm iterating over them. The PageNode.Url is always empty. Part of the problem might be that I'm getting the PageNodes by finding a parent page (titled "Careers") which is just a grouping page with no content. CareerLinkData is just a simple class with two string properties. I see references to a GetFullUrl() method in the forum, but it seems like it's not in Sitefinity anymore?

private List<CareerLinkData> GetCareerPages()
    List<CareerLinkData> results = new List<CareerLinkData>();
 
    var pageNodes = App.WorkWith().Pages().ThatArePublished().Where(pN => (pN.Page != null && pN.Parent.Title == "Careers")).Get();
 
    foreach (Telerik.Sitefinity.Pages.Model.PageNode pn in pageNodes)
    
        results.Add(new CareerLinkData(pn.Urls.FirstOrDefault().Url, pn.Title));
    
 
    return results;

Posted by Community Admin on 24-Aug-2012 00:00

Hi,

It appears that you need to add one or more of the below "using" statements (for C# developers) to reference the namespaces that will expose that method (via http://bit.ly/NNRPzr):

using Telerik.Sitefinity.Pages.Model;
using Telerik.Sitefinity.Modules.Pages;

This thread is closed