Channel Ratings Documentation

Rating - New Rating Tag

{exp:channel_ratings:new_rating}

Parameters

Parameter Description
entry_id For Channel Entries
url_title For Channel Entries
comment_id For Individual Comments
member_id For Site Members
ci_id For Channel Images
cf_id For Channel Files
cv_id For Channel Videos
br_id For BrilliantRetail Products
collection A specific rating collection. Default is "default".
min_value This parameter is used to force the user to have to submit a value equal to or higher than the specified value. Min value is 1.
max_value This parameter is used to force the user to have to submit a value equal to or lower than the specified value. Max value is 5.
allow_guests Allow guest submissions? Default is "no".
allow_multiple Allow multiple submissions? Lets say you want to allow people to rate an entry multiple times. Default is "no".
captcha Enable captcha? Default is "no".
return This parameter allows you to define where the user will be returned after submitting a rating. The parameter can be defined in two ways: Use the standard Template_Group/Template syntax to specify where to return the user. For instance, if you want the user to be returned to the “local” Template in the “news” Template Group, you would use: return=”news/local” Use a full URL. For example: return=”http://example.com/return.html“ If this parameter is not defined, they will be returned to the form page.
prefix This parameter allows you to change the default variable prefix used. This is especially useful when you are nesting tags to avoid variable collisions. Default is "rating".

Variables

Variable Description
{rating:captcha} This variable will render the captcha image is captcha in enabled

Variable Pairs

{rating:fields} Variable Pair Description
{rating:field_title} The rating field title
{rating:form_name} The form input name for this field

Conditionals

Conditional Description
{if rating:no_access} This tag will conditionally display the code inside the tag if the user has no access to view the form. This can happen if the user is banned OR is a guest and gues access is not enabled
{if rating:already_rated} This tag will conditionally display the code inside the tag if the user has already rated this item
{if rating:not_rated} This tag will conditionally display the code inside the tag if the user has not yet rated this item

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{exp:channel_ratings:new_rating entry_id="{entry_id}" captcha="yes" max_value="5" return="/channel_rating/new_rating/"}
 
        {if rating:already_rated} You have already rated this entry{/if}
 
        {if rating:not_rated}
 
                {rating:fields}
                        <label>{rating:field_title}</label>
 
                        <select name="{rating:form_name}">
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                        </select>
                {/rating:fields}
 
                {!-- YOU CAN STILL HARDCODE THE form input name, for example: <select name="rating[default]"> --}
 
                {if rating:captcha}
                        {rating:captcha}
                        <input name="captcha" type="text"/>
                {/if}
 
                <input type="submit">
        {/if}
 
{/exp:channel_ratings:new_rating}

Support

Having problems setting up and/or using Channel Ratings? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.