Rating for System operators

From Sense/Net Wiki
Jump to: navigation, search

Overview

Example title
As a system operator you can enable/disable rating on contents and for example reset rate values on contents. Rating is primarily stored on contents as a string. For administrating reasons they are stored in Content Repository, too.

Details

Enable/disable rating on contents

By default rating is disabled on contents. You can enable or disable rating in three steps.

Content type definiton

First you have to add or modify the following field to its content type definiton this way so the rating can be enabled or disabled in edit mode on the content:

    <Field name="IsRateable" type="Boolean">
      <Title>Enable Rating</Title>
      <Description>Specify whether you would like to enable rating capability for this content.</Description>
      <Configuration>
        <VisibleBrowse>Show</VisibleBrowse>
        <VisibleEdit>Show</VisibleEdit>
        <VisibleNew>Show</VisibleNew>
        <DefaultValue>false</DefaultValue>
      </Configuration>
    </Field>

Secondly you have to add or modify the following field to its content type definiton this way so the rating can be seen in different views on the content:

    <Field name="Rate" type="Rating">
      <Title>Rate</Title>
      <Description>Average rate of the content.</Description>
      <Bind property="RateStr" />
      <Bind property="RateCount" />
      <Bind property="RateAvg" />
      <Configuration>
        <VisibleBrowse>Show</VisibleBrowse>
        <VisibleEdit>Show</VisibleEdit>
        <VisibleNew>Show</VisibleNew>
        <Range>5</Range>
        <DefaultValue>0.00|0|0|0|0|0</DefaultValue>
      </Configuration>
    </Field>

In edit mode

After the first two step you can check the IsRateable checkbox to enable or disable the rating on contents datasheet in any view.

The following picture shows how to enable rating on a content in edit mode:

The IsRateable field in edit mode

After this the rating is enabled on the content and you can see it as the picture show below:

TODO://Missing picture!


Reseting rates

If you have administrator permission in your system you can reset the rating values on any of the contents that has rating enabled on. You just simply check the 'reset' checkbox and save the content to reset it's rate values to zero. See image below:

TODO://Missing picture!

Related links

References