0

I need some help, about Solspace Rating,

If the entry named hamburger was rated 20 times, there are 20 Entry's Rating with the hamburger name, in the Rating's Control Panel.

When I Using this code, the 20 Entry's Rating of the Hamburger Rated entries are displayed on 20 lines. How to display only one line, and not all the entries, where appear the average note of all the hamburger Entry's Rating and of the other ones?

{exp:rating:entries}
        <ul>
            <li>
                {exp:rating:stats entry_id="{entry_id}"}
                     {stars_avg_rating}
                {/exp:rating:stats}
            </li>
        </ul>
{/exp:rating:entries}

Update:

Using this code, appear the average's notes of the Rated entries

{exp:channel:entries channel="receitas"}
    {exp:rating:entries limit="1" }
            <ul>
                <li>
                    {exp:rating:stats entry_id="{entry_id}"}
                         {title}{stars_avg_rating}
                    {/exp:rating:stats}
                </li>
            </ul>
    {/exp:rating:entries}
{/exp:channel:entries}

Does exist a more direct method than parsing exp:rating:entries inside exp:channel:entries ??

0

I think you can do it like this:-

<ul>
    {exp:channel:entries channel="receitas"}
        <li>
            {exp:rating:stats entry_id="{entry_id}"}
                {title} - {stars_overall_avg}
            {/exp:rating:stats}
        </li>
    {/exp:channel:entries}
</ul>
2
  • 1
    Andrew, the problem was independent about the <ul> position , all the Rating entries was displaying. I found a better solution than exp:channel in this case: using {exp:rating:rank} instead {exp:rating:entries}, no need more exp:channel:entries.
    – Stéphane
    Mar 2 '14 at 20:29
  • Glad you got it fixed. Could you submit it as an answer here so others can clearly see in future?
    – Mutual
    Mar 2 '14 at 20:31
0

Andrew,

the problem was independent about the <ul> position , all the Rating's entries was displaying. I found a better solution than to parse inside exp:channel in this case: using {exp:rating:rank} instead {exp:rating:entries}, no need more exp:channel:entries.

<ul>
{exp:rating:rank}
        {exp:rating:stats entry_id="{entry_id}"}
               <li>
                    {exp:rating:stats entry_id="{entry_id}"}
                         {title}{stars_avg_rating}
                    {/exp:rating:stats}
                </li>
                {/exp:rating:stats}
{/exp:rating:rank}
</ul>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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