0

I'm using Rating 3.2.3 and EE 2.7.2.

In my template, the tag {if rating_comment_no_results} never returns true and never displays its content, even when there are no comments for that rating.

Template code (this is on a single entry page inside channel:entries):

{embed="vendor/.ratings" entry-id="{entry_id}" vendor-type="{categories show_group="10" limit="1"}{category_url_title}{/categories}"}

And that embed looks like this (some pieces removed for brevity):

{exp:rating:entries precision="2" orderby="rating_date" sort="desc" img_height="14" img_width="14" collection="directory" entry_id="{embed:entry-id}" limit="200"}

{exp:rating:comments
     rating_id="{rating_id}"
     limit="1"
     status="open|closed" 
}
<div class="vendor-reply">
<h5>Reply from {title}</h5>
<h6>{rating_comment_date format="%F %d, %Y"}</h6>
<div class="restrict-height">
{rating_comment}
<div class="overflow"><a href="#">Read more…</a></div>
</div>
</div>
{if rating_comment_no_results}
{if logged_in_member_id == author_id}
{embed="vendor/.rating-reply" rating-id="{rating_id}"}
{/if}
{/if}
{/exp:rating:comments}

{/exp:rating:entries}

And then inside that next embed we have:

{exp:rating:comment_form
    form:class="review-reply"
    rating_id="{embed:rating-id}"
    return="vendor/rating-reply-thanks/{segment_2}"
    status="closed"
    require_membership="yes" 
    anonymous="no" 
}
    <label>Reply to this review <span class="expl">This option is available only to the listing owner</span></label>
    <textarea class="autosize" placeholder="Write your reply…" name="comment" /></textarea>
    <a class="btn directory submit" href="#">Submit Reply</a>
{/exp:rating:comment_form}

With the {if rating_comment_no_results} conditional in place, the second embed never shows, even when the conditional is true. If I remove that conditional it shows as expected so there's no problem with the embeds or other code. The conditional simply doesn't work.

Any ideas Solspace?

2
  • Have you tried a hard-coded string in the conditional such as {if rating_comment_no_results}No results.{/if} for testing?
    – Solspace
    Feb 5, 2014 at 3:29
  • Yes I have. It doesn't show. Feb 5, 2014 at 4:48

1 Answer 1

1

Try {if rating_no_results} ... {/if}, which is the "no results" conditional used in the other Rating tags. Looks like the "comment" part should be removed in the docs.

2
  • {if rating_no_entries} does not work, however {if rating_no_results} does seem to work. Any possible conflict between rating:comments and rating:entries no_results conditional if one is inside the other and they both use the same conditional tag? Feb 9, 2014 at 8:54
  • Sorry! I meant {if rating_no_results} ("_entries" is definitely wrong). Edited the answer above.
    – Solspace
    Feb 9, 2014 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.