Are you a Solspace Rating Module Jedi? I need your help!
Posted: 17 March 2008 12:29 PM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1811
Joined  08-02-2006

I’ve got the rating module set up on a site of mine. Here’s what I’m using to display the current rating:

{exp:rating:stats entry_id="{entry_id}" theme="default" scale="5"}
{stars_overall_avg}
<p>Based on {overall_count} review{if overall_count !="1"}s{/if}</p>
{/exp:rating:stats}

This all works just great once a rating has been recorded. The problem is when no rating as been recorded, no stars show at all. I was under the impression that if no rating had been received, it would simply show 5 (or 10) gray stars indicating that it had no rating yet.

I’ve got a post in over at Solspace where one of their support people said it’s not possible the current functionality, but I didn’t know if someone here had a slick work around? Seems like this would be pretty common.

Thanks

 Signature 

Deron Sizemore
==========
Random Jabber | Sizcons | NiceStylesheet | Kentucky Golfing | LogoGala
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 17 March 2008 01:47 PM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1811
Joined  08-02-2006

Hmmm, doesn’t seem to be doing anything. Here is what I’ve got (using this inside the weblog entries tag)

{exp:weblog:entries weblog="courses" disable="categories|pagination|trackbacks" require_entry="yes"}
        
<h1>{title}</h1>
        
        <
div id="coursesTop" class="clearfix">
            <
div id="ratingFavoriteInfo">
                <
p class="strong">Course Rating:</p>
                
{exp:rating:stats entry_id="{entry_id}" theme="default" scale="5"}
                {if overall_count
== "0" OR overall_count == ""}
                
<img src="{base_url}assets/images/design/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="{base_url}assets/images/design/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="{base_url}assets/images/design/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="{base_url}assets/images/design/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="{base_url}assets/images/design/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" />
                
{/if}

                {stars_overall_avg}
                
<p class="reviewsBasedOn">Based on {overall_count} review{if overall_count !="1"}s{/if}</p>
                
{/exp:rating:stats}

                
<p class="favorites"><a href="#" title="Add to Favorites List" class="favoriteIt">Add to Favorites List</a></p>
            </
div>

...
more course info...

...
rating form code....

You can check out the page here: http://www.kentuckygolfing.com/courses/details/kearney-hill-golf-links

and here’s the page after a rating is recorded:
http://www.kentuckygolfing.com/courses/details/valhalla-golf-club

 Signature 

Deron Sizemore
==========
Random Jabber | Sizcons | NiceStylesheet | Kentucky Golfing | LogoGala
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 17 March 2008 06:48 PM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1811
Joined  08-02-2006

I’ve got it sorted out I believe. I ended up using {if no_results} outside of the weblog:entries tag and it seems to work.

 Signature 

Deron Sizemore
==========
Random Jabber | Sizcons | NiceStylesheet | Kentucky Golfing | LogoGala
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 17 March 2008 08:13 PM   [ Ignore ]   [ # 3 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1811
Joined  08-02-2006

I actually have ran into another issue here.

Consider this code from the template:

{if overall_count == "0"}<p class="reviewsBasedOn">No reviews yet</p>{/if}
<p class="reviewsBasedOn">Based on {overall_count} review{if overall_count !="1"}s{/if}</p>

I’m sure you can see what I’m trying to do here. If no rating is present, show “no rating yet” otherwise show the regular “based on…” verbiage. The weird thing is that overall_count nor no_results will work in this matter (even though I just used no results to display gray stars when no rating was present. So, I really don’t understand that unless my conditional code is just plain wrong?

 Signature 

Deron Sizemore
==========
Random Jabber | Sizcons | NiceStylesheet | Kentucky Golfing | LogoGala
Twitter: Deron Sizemore | LogoGala

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 77454 Total Logged-in Users: 49
Total Topics: 101500 Total Anonymous Users: 26
Total Replies: 544226 Total Guests: 264
Total Posts: 645726    
Members ( View Memberlist )