Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hello! I using votes addon from couchcms, and it's working great. I have made so people can votes for every video I make.

But now I have a question, I want to make so most voted video, going to number one in (Tables).

My tables I have made is like this:

Code: Select all
<cms:pages masterpage="movies.php">
    <table style="width:100%">
        <tr>
          <td>
            <a href="<cms:show k_page_link />"><cms:show k_page_title /></a>
          </td>
          <td class="views-right">
            <cms:show my_vote />
          </td>
        </tr>

    </table>
    </cms:pages>
  </section>



And I want to make same table like this, but that video with most votes going to be top of my table list.


Hope you understand what I mean thanks..
Hi,

Assuming the name of your vote type region is 'my_vote', please try the following -
Code: Select all
<cms:pages orderby='my_vote' order='asc' limit='5' >
    ... this will list the top 5 pages with highest number of votes ..
</cms:pages>

This technique is actually noted in the docs (viewtopic.php?f=5&t=8133) -
The key above is the use of the vote type region with the 'orderby' parameter.

Hope it helps.
KK wrote: Hi,

Assuming the name of your vote type region is 'my_vote', please try the following -
Code: Select all
<cms:pages orderby='my_vote' order='asc' limit='5' >
    ... this will list the top 5 pages with highest number of votes ..
</cms:pages>

This technique is actually noted in the docs (viewtopic.php?f=5&t=8133) -
The key above is the use of the vote type region with the 'orderby' parameter.

Hope it helps.



Working great thanks!
3 posts Page 1 of 1