Looking for some help getting the module on my site
Posted: 14 May 2008 12:33 PM   [ Ignore ]
Newbie
Rank
Total Posts:  5
Joined  2007-03-24

I’ve read the docs over and over since buying this module, but I cannot understand how to get this working.  I have the module installed, but now I want to integrate just one thing into my site: AJAX stars as described here.

I’m completely lost.  Is there a simple-to-understand step-by-step anywhere to get the basic ratings system in your templates?  If I could get that going I could probably see how to getting the AJAX mod done.

Profile
 
 
Posted: 15 May 2008 06:33 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2732
Joined  2006-10-18

JimK,

Make sure you read past the first message for other fixes that were later added to it smile
Secondly, make sure you have your /_incs/prototype.js template set to ‘static’

 Signature 
Profile
 
 
Posted: 15 May 2008 05:02 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  5
Joined  2007-03-24

I think we’ve got our wires crossed.  I probably shouldn’t have mentioned the AJAX mod yet.  The thing is, I can’t even get the ratings mod working at all.  Maybe it’s me, but the documentation is *very* confusing and I can’t figure it out.  I have it installed just fine, I just can’t get it working on my site.

I’ll be honest, I don’t even know where to begin.  The docs are just not clear.  I was hoping someone had a simplified, step-by-step guide.

Profile
 
 
Posted: 16 May 2008 07:09 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2732
Joined  2006-10-18

Sorry Jim smile

I guess the first thing you’re going to need is a Rating:Form

So to start you off, I’ve provided an example from the Docs:

{exp:rating:form entry_id="{entry_id}" form_name="review" require_membership="yes" status="open" return="{path='rating/thanks'}"}
<input type="hidden" name="name" value="{screen_name}" />
<
input type="hidden" name="email" value="{email}" />
<
label for="review">Your Rating</label>
<
select name="rating">
<
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>
<
label for="review">Your Review</label>
<
textarea name="review" rows="10" cols="40"></textarea>
<
input type="submit" name="submit" value="Submit!" />
{/exp:rating:form}

This code can be placed inside or outside of the Weblog:Entries loop on a Single Entry page, (though I would place OUTSIDE of the weblog:entries loop).

Parameters:
So what’s happing in here, is that the entry_id parameter will relate the Rating to the weblog entry.
The form_name parameter will create a dynamic form name as an extra way of sorting entries. It’s your option of how you want to organize this. An example might be, using this form on Restaurant Reviews, Movies Reviews, Hotel Reviews… you might want to group your ratings by “restaurant”, “movies”, hotels”, etc. It’s all dynamic, so you don’t need to create anything for a “Form name” in the CP… it’s like Freeform (if you’re familiar with it).
The require_membership parameter is self explainitory… the person must be a logged in member to submit ratings when set to YES.
The status parameter sets the status of which the Rating will go into once submitted. Setting the status to closed will allow you to review them first (in the CP).
The return parameter allows you to specify which template you want the member to go to once rating is submitted.

As for form fields:
Both the name and email form fields are required. Because we’re assuming you want your ratings submitted only from logged in members (with the require_membership parameter specified), showing the Name and Email fields is a little redundant. We still need them though, so we’ve hid them, and plopped in the {screen_name} and {email} variables to automatically grab this data.
The rating and review form fields are default fields from the Rating Module. They already exist in the CP as fields. You can create more in the Rating CP and add them as form fields in your Rating Form, should you want to collect more data smile

CP Home › Modules › Rating › Manage Fields >> click Create New Field

That’s it! The FORM is done.

Now, you’re probably going to want to display the Ratings rasberry
You’re going to want to use the Rating:Entries loop for this.
Simple example from the Docs:

{exp:rating:entries limit="10"}

<p>{stars}{rating}{/stars}</p>
<
p><a href="/user/edit/{rating_author_id}">{screen_name}</a></p>
<
p>Date: {rating_date format="%m/%d/%y"}</p>
<
p>Review: {review}</p>
<
hr />

{/exp:rating:entries}

So we’ve specified a very simple example here. You would place this on a Single Entry page outside of the Weblog:Entries loop as well.
There’s more parameters you can use to filter and organize your results, but we’ve only chosen the “limit” parameter here. The form will only show up to 10 results.
You can see we’ve included the {rating}, {screen_name}, {rating_author_id}, {rating_date}, and {review} variables. The {stars}{/stars} variable pair is special that is converts your {rating} variable into a visual element - Stars images. The {rating_date} variable can be controlled in which format you want the date to display smile

The Rating Module goes a lot further than this. I hope that made sense, and gives you a good start with it. See if you can get those two working for you, and add to it from there (if necessary) smile

If you have any further questions, please let me know wink

 Signature 
Profile