2 of 2
2
Just purchased - Couple questions and a couple problems
Posted: 17 March 2008 08:43 PM   [ Ignore ]   [ # 16 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18
deronsizemore - 17 March 2008 06:03 PM

Success! Although, I’m still confused as to what could be going on here. In your last post, you said that you could not get overall_count variable to work but you were able to get the no_results conditional to work outside of a weblog entries loop. Yet, in your example, unless I’m seeing things, you used overall_count, not no_results?

I couldn’t get overall_count to work either and just used the code you posted only changed overall_count to no_results and now it works. Was your last post just a typo?

Yes, that was a typo… sorry! LOL
I actually just took your code and broke up the Weblog:Entries loop, and forgot to switchup the conditional rasberry

As for your other issue.... what are you using… the {if overall_count}, or {if no_results}?

 Signature 
Profile
 
 
Posted: 17 March 2008 08:47 PM   [ Ignore ]   [ # 17 ]
Sr. Member
RankRankRankRank
Total Posts:  153
Joined  2007-02-19

I’ve tried both the {if overall_count} as well as {if no_results} and neither one has any effect whatsoever on the text displayed. Which, really, really seems weird since they work in other instances in that same area there, so I assumed it had to be me mucking up the conditional as to why it wasn’t working. I mean, the {if overall_count} works in this case for the “s” to show when more than one rating:

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

So I really can’t see why it won’t work in this instance:

{if overall_count == "0"}<class="reviewsBasedOn">No reviews yet</p>{/if}

Profile
 
 
Posted: 17 March 2008 08:50 PM   [ Ignore ]   [ # 18 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

Sorry Deron… it’s late… I’m a little lost, haha LOL

What is it you want it to show exactly… and what is and isn’t showing? smile

 Signature 
Profile
 
 
Posted: 17 March 2008 09:11 PM   [ Ignore ]   [ # 19 ]
Sr. Member
RankRankRankRank
Total Posts:  153
Joined  2007-02-19

hehe, I know how you feel. I think I’ve been looking at this too too long. I’ll be going to sleep after this post and maybe it will make more sense in the morning? wink

Anyway, if you check out this entry: http://www.kentuckygolfing.com/courses/details/valhalla-golf-club and you can see the course rating in the top left by the map. Right below the stars should be “rated 4 times” or whatever. What I’m trying to do is, on the entries in which do not have a rating yet, in place of “rated 4 times” I’m trying to show “No ratings yet” or similar.

Thanks

Profile
 
 
Posted: 17 March 2008 09:15 PM   [ Ignore ]   [ # 20 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

That’s what I thought....

But have you tried tucking in that text with the stars {if no_results} conditional?

{if no_results}
  
<img src="http://www.kentuckygolfing.com/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="http://www.kentuckygolfing.com/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="http://www.kentuckygolfing.com/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="http://www.kentuckygolfing.com/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="http://www.kentuckygolfing.com/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" />
<
p>No results yet</p>
  
{/if}

 Signature 
Profile
 
 
Posted: 18 March 2008 05:40 AM   [ Ignore ]   [ # 21 ]
Sr. Member
RankRankRankRank
Total Posts:  153
Joined  2007-02-19
Pie Man - 17 March 2008 09:15 PM

That’s what I thought....

But have you tried tucking in that text with the stars {if no_results} conditional?

{if no_results}
  
<img src="http://www.kentuckygolfing.com/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="http://www.kentuckygolfing.com/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="http://www.kentuckygolfing.com/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="http://www.kentuckygolfing.com/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="http://www.kentuckygolfing.com/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" />
<
p>No results yet</p>
  
{/if}

Uuhhhhhg! I’m really sorry. Yes, that worked perfectly. I had tunnel vision I suppose and couldn’t see the most obvious solution to my problem. I guess that’s what I got you for, right? To point out the obvious? wink

Hopefully I can leave you alone for a while now on the ratings module matter. wink

Thanks again.

Profile
 
 
Posted: 18 March 2008 06:13 AM   [ Ignore ]   [ # 22 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

Hahaha… just don’t buy anything else.... please! rasberry LOL

Just kidding.... you’re welcome to bug me anytime wink

 Signature 
Profile
 
 
Posted: 12 September 2008 02:30 AM   [ Ignore ]   [ # 23 ]
Jr. Member
RankRank
Total Posts:  40
Joined  2008-04-04
Pie Man - 17 March 2008 11:08 AM

deronsizemore - 17 March 2008 10:59 AM
So, in the meantime, can you think of anything at all I can do to duplicate what I’m after? I don’t even have to show gray stars when there is no rating… I could just use a conditional to show the text “no rating yet” or similar if you could think of a conditional that I could use? I’m drawing a blank.

I’m an idiot again… that count conditional wont work because there’s no data for it to base itself off of…
I’m afraid I cannot think of any easy workaround for this at the moment…

deronsizemore - 17 March 2008 10:59 AM

I’m not sure what you mean by “gather the entry ID or URL title then output the custom field into that URL. Would this custom field need to be included into the rating form but hidden?

Correct! smile

Create the custom rating field, place as ‘hidden’ in your form, and, if you’re displaying the form on a Single Entry page, then grab that part of the URL by placing {segment_3} as the value. wink

Sorry, I’m being really thick on this ... I just don’t ‘get it’. I would like the URL to appear in the notification email sent out too - I tried ‘http://www.site.com/template_group/template/{entry_id}’ but that didn’t work out. A simple walk-through / step-by-step explanation for this would be extremely welcome (e.g. what goes into the custom rating field? what code into the form? grab what of the URL? what is {segment_3}? ...).

Thanks in advance.

KCesp

Profile
 
 
Posted: 15 September 2008 08:01 AM   [ Ignore ]   [ # 24 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

KCesp,

The general idea is that the {entry_id} variable is NOT available in the Notification template. Custom Rating fields are, however. smile

The workaround is that in the time being, you could create a custom field for Rating called “rating_entryid” or something (just don’t want to call it {entry_id} in case it causing an overlap now or in the future.

You could then capture the Entry ID of the Weblog Entry in that custom field in the Rating Form

Then, set your form like this (where you hide the field):

{exp:rating:form entry_id="{entry_id}" form_name="review" require_membership="yes" admin_template="admin_template" anonymous="yes" status="open" return="{path='rating/thanks'}"
<input type="hidden" name="name" value="{screen_name}" /> 
<
input type="hidden" name="email" value="{email}" />
<
input type="hidden" name="rating_entryid" value="{entry_id}" />
<
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}

In your Notification template, do something like this: smile

Hello!

The has been a new Rating submitted!

Check it out here:

http://www.site.com/template_group/rating/{rating_entryid}/

 Signature 
Profile
 
 
Posted: 17 September 2008 04:59 AM   [ Ignore ]   [ # 25 ]
Jr. Member
RankRank
Total Posts:  40
Joined  2008-04-04

Hello again.

Thank you for the explanation. Here are the steps I have taken …

+++++

#1. Create a custom field

In EE: CP Home › Modules › Rating › Manage Fields › Create Field

Name = rating_entryid
Label = Rating Entry
Type = Text Area
Format = Br

#2. Add ‘hidden’ element to form page

I have this …

{exp:rating:form entry_id="{entry_id}" form_name="review" require_membership="no" anonymous="yes" required="rating|review" status="open" notify="name@email.com" admin_template="admin_template_name" user_template="user_template_name" return="{path='/template/template_name/'}"}
<input type="hidden" name="rating_entryid" value="{entry_id}" />
<
table width="100%" border="0" cellspacing="0" cellpadding="0">
<
tr>
<
td>
<
label for="review">Your rating: </label>
<
select name="rating" class="search_box">
<
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> <img src="http://www.domain.com/dir/dir/rating_star.gif" alt="0" border="0" class="rating_star" /><br />
<
br />
<
div class="comments_form_name">Full name</div>
<
input name="name" type="text" class="search_box" size="30" />
<
br />
<
div class="comments_form">Contact email</div>
<
input name="email" type="text" class="search_box" size="30" />
<
br />
<
div class="comments_form">Your comments</div>
<
textarea name="review" cols="55" rows="12" class="search_box"></textarea>
<
br />
<
div><input type="checkbox" name="notify_me" value="y" />Notify me of additional ratings and comments</div></td>
</
tr>
</
table>
  
<
br />
 
<
input name="submit" type="submit" class="formbut" value="Submit" />{/exp:rating:form}

#3. In the notification templates (for use and admin)

I have this …

Someone has posted a rating. Here are the details:

Entry Date: {entry_date}
http://www.domain.com/dir/index.php/template/template_name/{rating_entryid}/

{all_custom_fields}

+++++

… but I’m still not having any joy. This is what is returned via email:

Someone has posted a rating. Here are the details:

Entry Date: 2008-09-17 13:52
http://www.domain.com/dir/index.php/template/template_name/{entry_id}/

Review: And this to delete too (test!)
Rating: 3
Rating Entry: {entry_id}
Name: name
Email: name@domain.com

It has to be something I am missing in the process of it all. Can you spot where I have messed up? I’ve got the feeling it’s something really simple ...

Thanks again.

KCesp

Profile
 
 
Posted: 17 September 2008 11:54 AM   [ Ignore ]   [ # 26 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

KCesp ,

You need to make sure that you have the Rating:Form wrapped in the Weblog:Entries loop so that {entry_id} would be parsed. If you’re viewing the Entry with the Entry ID in the URL anyways, then you could pull it with the {segment_3} variable:

<input type="hidden" name="rating_entryid" value="{segment_3}" />

Now that I think about it, if you have the URL title in the URL too, it would work just the same:

<input type="hidden" name="rating_entryid" value="{segment_3}" />

And would output

http://www.domain.com/dir/index.php/template/template_name/url_title_of_entry/

If it’s still causing you some grief, let’s not worry about this workaround LOL

We’re rolling out a new version of Rating (again!) this week, which will include usage of {entry_id} and {url_title} variables in Notification templates. smile

 Signature 
Profile
 
 
Posted: 18 September 2008 01:05 AM   [ Ignore ]   [ # 27 ]
Jr. Member
RankRank
Total Posts:  40
Joined  2008-04-04

Hi Pie Man.

Phew. No idea how you manage to get your ahead around all of this!

Thank you for the feedback and explanation. If I were in a super-rush, I would continue playing with the workaround ... but given that you say there is a ‘fix’ in the new version of Rating ... guess what? ... I think an extra day or two waiting wouldn’t be a problem.

Great work - keep it up!

KCesp

Profile
 
 
Posted: 18 September 2008 06:33 AM   [ Ignore ]   [ # 28 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18
KCesp - 18 September 2008 01:05 AM

Phew. No idea how you manage to get your ahead around all of this!

I surprise myself sometimes cheese

 Signature 
Profile
 
 
Posted: 09 October 2008 07:38 PM   [ Ignore ]   [ # 29 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

KCesp,

Sorry for the wait on this one…

The {url_title} and {entry_id} variables are now available for use in the Notification templates in Rating 2.2.1 smile
http://www.solspace.com/forums/viewthread/1368/

 Signature 
Profile
 
 
   
2 of 2
2