The following code example shows how rating of a document can be modified using the API.
[C#]
using CMS.TreeEngine; using CMS.CMSHelper;
int nodeId = 241; double rating = 1.0f; int numOfRatings = 2;
// Get the document TreeProvider tree = new TreeProvider(CMSContext.CurrentUser); CMS.TreeEngine.TreeNode node = tree.SelectSingleNode(nodeId, CMSContext.PreferredCultureCode);
// Modify its rating TreeProvider.SetRating(node, rating, numOfRatings); |
Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?api_modifying_document_rating.htm