Getting document rating

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

The following code example demonstrates how you can get rating of a document using the API.

 

[C#]

 

using CMS.TreeEngine;

using CMS.CMSHelper;

 

int nodeId = 241;

double rating = 0.0f;

 

// Get the document

TreeProvider tree = new TreeProvider(CMSContext.CurrentUser);

CMS.TreeEngine.TreeNode node = tree.SelectSingleNode(nodeId, CMSContext.PreferredCultureCode);

 

// Get its rating

rating = node.DocumentRatingValue / node.DocumentRatings;

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?api_getting_document_rating.htm