Modules > Content rating > Content rating internals and API:
Resetting document rating
Resetting document rating
The following code example shows how to reset content rating of a document using the API.
[C#]
using CMS.DocumentEngine; using CMS.CMSHelper;
int nodeId = 241;
// Get the document TreeProvider tree = newTreeProvider(CMSContext.CurrentUser); TreeNode node = tree.SelectSingleNode(nodeId, CMSContext.PreferredCultureCode);
// Reset its rating TreeProvider.ResetRating(node);