How can I get the property Description or Keywords from Page

Posted by Community Admin on 03-Aug-2018 14:22

How can I get the property Description or Keywords from PageNode?

All Replies

Posted by Community Admin on 10-May-2011 00:00


var pageNodes = App.WorkWith().Pages().LocatedIn(PageLocation.Frontend)
    .Where(p => p.ApprovalWorkflowState.Value == "Published")
    .Get().ToList()
    .Where(p =>
    
        return !p.IsBackend &&
            !String.IsNullOrEmpty(p.Title) &&
            p.Description.Value.Contains("<!--WhereToBuy-->");
    )
    .FirstOrDefault();

I've set both Description and Keywords with this value, but this property doesn't seem to be the one I am looking for. How can I access those properties?

Posted by Community Admin on 12-May-2011 00:00

Hello Bruno,

Please refer to the code sample bellow which contains the needed logic if you want to get page's description and keywords ( feel free to customize it so it suits your needs):

App.WorkWith()
              .Pages()
              .Where(p => p.ApprovalWorkflowState.Value == "Published")
              .Where(p => p.Page.Status == ContentLifecycleStatus.Live)
              .ForEach(p =>
              
                  var htmltitle = p.Page.HtmlTitle;
                  var description = p.Page.Description;
 
                  var keywords = p.Page.Keywords;
              )


Best wishes,
Victor Velev
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

This thread is closed