doublesecretagency / craft-upvote

Upvote plugin for Craft CMS
Other
15 stars 6 forks source link

How to output multiple votes? #17

Closed AntonioStudioUntitled closed 4 years ago

AntonioStudioUntitled commented 4 years ago

Awesome plugin, thank you for making one.

I was trying to find a solution for this, but I couldn't find one.

What is the best way to show results for each multiple votes?

Was the hotel comfortable?

{{ craft.upvote.upvote(hotel.id, 'comfortable') }} {{ craft.upvote.downvote(hotel.id, 'comfortable') }}

Was the hotel clean?

{{ craft.upvote.upvote(hotel.id, 'clean') }} {{ craft.upvote.downvote(hotel.id, 'clean') }}

Was the hotel staff friendly?

{{ craft.upvote.upvote(hotel.id, 'friendlyStaff') }} {{ craft.upvote.downvote(hotel.id, 'friendlyStaff') }}

for example

{{ craft.upvote.totalUpvotes(elementId) }}

this shows normal votes, what's the best to show multiple votes?

AntonioStudioUntitled commented 4 years ago

I guess this is the way to output right? {{ craft.upvote.totalUpvotes(elementId, 'clean, 'container'') }}

lindseydiloreto commented 4 years ago

Yup, that's correct!

{{ craft.upvote.totalUpvotes(elementId, 'clean') }}

container is the default value of the third parameter, so you actually don't even need to specify it.

https://www.doublesecretagency.com/plugins/upvote/docs/control-the-output-format