Kentico CMS 7.0 Developer's Guide

Resetting document rating

Resetting document rating

Previous topic Next topic Mail us feedback on this topic!  

Resetting document rating

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

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 = new TreeProvider(CMSContext.CurrentUser);
TreeNode node = tree.SelectSingleNode(nodeId, CMSContext.PreferredCultureCode);

 
// Reset its rating
TreeProvider.ResetRating(node);