Learn how users value your web content
Composite.Community.Raty allows the visitors to a website rate pages, images and other content on a website. The rating feature is based on Raty, a jQuery plugin that automatically generates a customizable star rating.
When adding the rating feature to pages or templates, you can specify how many stars must be shown and whether a half-star rating is allowed.
How to implement
- Edit a page or a template.
- Insert the
Composite.Community.Raty function (
Insert |
Function) or add the code:
<f:function name="Composite.Community.Raty" xmlns:f="http://www.composite.net/ns/function/1.0"> <f:param name="RatyId" value="" /> <f:param name="Half" value="True" /> <f:param name="Number" value="5" /> <f:param name="ReadOnly" value="False" /> </f:function>
- Set one or more parameters:
- RatyId: The GUID of a data item (a page, an image, a media file etc) to rate. The current page ID by default.
- Half: When 'True', a half -star can be displayed and selected; otherwise, a single star. A half-star ('True') by default.
- Number: The number of stars to present. 5 by default.
- ReadOnly: When 'True', the stars are read-only and cannot be selected. 'False' by default.
The "RatyId" can be set programmatically when calling the Composite.Community.Raty function from another function (for exampe, to rate a number of images on a page).
Requirements
Composite C1 version 2.1.1