Involver Developer Network : rate
This page last changed on May 29, 2012 by jed.wheeler@involver.com.
General ConsiderationsThis tag allows for the user to rate an item on a 5-star scale. A user's rating is only recorded once and any changes to his or her rating will overwrite the old rating. Caching ConsiderationsThe average rating may not reflect the latest ratings during times of high load. Because of the Caching system used to maintain page performance, ratings should be accurate to within 10 minutes. Because of the relatively large amount of data we need to push to create the rating system functionality (it requires over-writable values that allows us to track who has rated each item, what value each user gave each item, and also generate and update an average rating with each entry) this functionality cannot be used with more then 300 items at any given time. This restriction means we cannot enable rating as a sorting criteria on the paginate helper block since there's no way to restrict the total number of items paginate sorts. Instead, we recomend using the sort_by attribute on the for loop. Attributes
Examples<h2>Tweets from Involver, Follow us<br> @<a href="http://www.twitter.com/involver">Involver</a></h2> {% twitter_feed %} {% paginate twitter_feed.tweets per_page:5 %} {% for story in tweets %} <div class="tweet"> <h3>{{ story.title | twitter_link | auto_link }}</h3> <p>{{ story.published_relative_time }} - {% rate story %}</p> </div> {% endfor %} {% endpaginate %} {% endtwitter_feed %} Rate ImageThe rate image should contain three square icons stacked vertically ordered from the top as not selected, selected, hover. The default size for each icon is 16x16px. If another size is needed, please provide it as an attribute for the tag. Example: Access Rating InformationEvery content item has the following attributes to retrieve rating information
|
![]() |
Document generated by Confluence on Feb 12, 2013 09:09 |