Telerik.Sitefinity.Pages.Model.PageNode does not contain an definition for 'Keywords'
Has the way to access keywords from pages changed in recent versions? I can't find anything online, which shows a way to do it differently than my code below. I can access a page title, description, name, but when I try to get the keywords it throws an error. What am I missing?:
Here is my code:
var fluentPages = App.WorkWith().Pages();
var childPages= fluentPages.LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend)
.Where(p => p.Parent.Id == currentPageID && p.NodeType == NodeType.Standard && p.GetPageData().Status == ContentLifecycleStatus.Live)
.ThatArePublished()
.Get();
foreach
(var child
in
childPages)
string
thisTitle = child.Title.ToString().ToLower();
string
thisName = child.Name.ToString().ToLower();
string
thisDescription = child.Description.ToString().ToLower();
string
thisKeywords = child.Keywords.ToString().ToLower();
ERROR:'Telerik.Sitefinity.Pages.Model.PageNode' does not contain a definition for 'Keywords' and no extension method 'Keywords' accepting a first argument of type 'Telerik.Sitefinity.Pages.Model.PageNode' could be found (are you missing a using directive or an assembly reference?)C:\Program Files (x86)\Telerik\Sitefinity 7.152\Projects\KentuckyCenterSitefinity\Mvc\Models\AllShowsModel.cs23145SitefinityWebApp
Hi Chip,
The error states that PageNode does not contain a definition for 'Keywords' which is correct. Keywords is a property of the PageData, so you would have to call GetPageData() on the page before accessing its keywords like so:
string thisKeywords = child.GetPageData().Keywords.ToString().ToLower();