Get page metadata from API

Miguel Sanchez asked on January 23, 2016 05:43

I'm trying to programmatically retrieve the page metadata (keywords, page descriptions, etc.) from a document for example...

var pages = DocumentHelper.GetDocuments("CMS.MenuItem");      
foreach (var page in pages)
    {
        Console.WriteLine("The keywords for {0} are {1}", page.DocumentName, ????);
        Console.WriteLine("The page description for {0} is {1}", page.DocumentName, ????);
    }

Could someone fill in the blanks for me?

Correct Answer

Brenden Kehren answered on January 23, 2016 06:13

That information isn't available at the document level, it's available at the node level. So you need a tree node object and check the node.GetValue("DocumentPageKeywords") to get your values.

2 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.