0

I have a requirement where Admin will have the ability to turn ON/OFF the rating feature for SPO Pages and the UI Control should be able to display/hide based on the setting.

Steps for turning ON the Rating feature:

  • Document Library Settings -> Rating Settings -> Enable
  • Adding the below tag to the page layout.

    SharePointPortalControls:AverageRatingFieldControl id="PageRatingControl" FieldName="Rating (0-5)" runat="server" />

By doing so, I'm able to see the Rating control on the page but I'm not able to hide it even after disabling the Rating setting.

Am I doing something wrong? I'm thinking of a JSOM way of solving this.
Any suggestions are highly appreciated :)

  • I'm not sure why I couldn't paste the exact SharePoint tag. I have made it visible, only by removing the < tag from the front. – RealSteel Sep 3 '18 at 13:30
0

If you want to hide the Rating control, we can using the following CSS style to achieve it.

<style>
#RatingsCtrl_ctl00_PlaceHolderMain_PageRatingControl{
    display:none;
}
</style>
  • I would need to access the rating setting value if it is enabled/disabled in the javascript so that I would apply a CSS fix to make it display/hide. So, I'm looking for a way to access the Rating Setting in Javascript. – RealSteel Sep 4 '18 at 9:54
  • It is not an API can access the Rating Setting in JavaScript code. – LZ_MSFT Sep 5 '18 at 1:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.