New rating extension for eZ Publish

I've just uploaded a rating module to the contribution section on the eZ site. The Star Rating module introduces a datatype that can be added to any content classes to allow it to be rated. While I haven't checked the datatype has been designed so it should be possible to add multiple ratings to a single content class.

The extension has been designed with accessibility in mind and will function without javascript, images or CSS.

The catalyst for the extension was CSS star rating from Komodo Media and the extension contains CSS and images from this project.

To add some web 2.0 goodness, if the xajax extension is enabled and the user has access ratings will be done via ajax calls. The xajax component requires newer versions (0.5+) of the xajax library so it must be downloaded from the projects site an not from the contributions section of the eZ site.

View caching & dynamic content

One of the issues I came across is that by making the rating a datatype, is that the display gets "captured" in the view cache. This is not not good for a dynamic component. To prevent caching I tried setting the cache_ttl to zero in the datatype view, however this has no effect. It appears that this template setting only works when used in a view template...something to investigate.

An earlier strategy was to clear the view cache after each "vote" and while this works to some extent it fails with anonymous users. View caches are based on the user viewing the node, and because all non logged in users share the special anonymous user they also share the view caches. Once one anonymous user voted the page would be updated with the results and the voting disabled, however the next anonymous user to visit the page would see the cached page containing the result and be unable to vote.

A worthy addition to the eZ template system would be the ability to designate a block in any template as being dynamic and not cached.

The TODO list

Currently the TODO list stands at
  • Fetch most rated objects;
  • Set max rating in datatype (class or content?);
  • Ability to clear ratings from datatype;
  • Stats - An admin view of voting that displays an over view of the rated content. Allow filtering/ sorting by content type;
  • Options for vote uniqueness - currently per session only. This covers both Anonymous & logged in users. Could make it based on user_id or session so that logged in users can only vote once;
  • Ability to limit voting to logged in user;
  • Log IP addresses and add this in the mix of unique voting.
I'm not sure how quickly I'll get to these items, however the fetching of top rated items will be first cab off the rank.

If you find the extension useful, have any comments, or suggestions let me know via comments. Also if you use it in a public site drop me a line. Also nice to seeing ones creations in the wild!

Comments

  1. Any comments of similarity/difference from the ezVoteColletor extension?

    ReplyDelete
  2. Hi gggeek

    I must admit that I wasn't aware of the ezVoteColletor extension. I suspect this is because I was searching for "ratings".

    I've had a look the source and the main difference I can see is that the star rating extension is based around a datatype. As well as ease of use this will allow for many of the items in the TODO list to be configurable via the edit screens or either the class or the content object.

    Another difference is that the Star Rating extension supports anonymous votes, this is something that the readme.txt of ezVoteColletor states that it will not do.

    There are plenty of differences and I suspect the two projects have different end uses.

    Cheers
    Bruce

    ReplyDelete
  3. Hi,

    I am newbie to ezpublish. I am using it and its been great to see the star rating extension in it.
    I am unable to add the star rating attritbute to my existing site.

    Can you please explain me in detail how to add and use this extension.

    I have searched in forums but couldnt get a detailed explanation.

    Thank for the help in advance,
    Keshav

    ReplyDelete
  4. Hello Bruce, i just founded your rating sistem and i'd like to know if there is any news about new features: i'm planning to move a big site to Ez+Starrating...

    Best
    Roberto

    ReplyDelete
  5. How do you add starratting to your class?

    ReplyDelete

Post a Comment

Popular posts from this blog

eZ Publish Admin Prototype extension

eZ Publish 5 Virtual Machine

eZ Publish Admin redesign - Dashboard = OpenSocial?