Fortunately, the answer is in docs to vote module viewtopic.php?f=5&t=8133
Thanks for pointing me to the documentation. I realized I did not use the <cms:show_votes>.
The voting module works perfect with the bwo buttons to up or down vote with out multiple interactions. Just one click and its done.
As a reference to others, This is the working code:
#1 Editable region:
- Code: Select all
<cms:editable type='vote_updown' search_type='decimal' name='my_vote' label='Votes Casted' />
#2 Form and the Single Click Voting Buttons:
- Code: Select all
<cms:form class="detail-banner-btn" masterpage='business-listing.php' page_id="<cms:show k_page_id />" mode="edit" method="post" anchor="0">
<cms:if k_success>
<cms:if "<cms:gpc 'vote_up' />">
<cms:db_persist_form my_vote='1' />
<cms:else_if "<cms:gpc 'vote_down' />" />
<cms:db_persist_form my_vote='-1' />
</cms:if>
<cms:if k_success >
<cms:set_flash name='success_msg' value="Thanks for your feedback!" />
<cms:redirect k_page_link />
</cms:if>
</cms:if>
<button type="submit" name='vote_up' class="detail-banner-btn" value="1">
<i class="fa fa-thumbs-o-up"></i> Like (<cms:show_votes 'my_vote'><cms:show count_up /></cms:show_votes>)
</button>
<button type="submit" name='vote_down' class="detail-banner-btn" value="1">
<i class="fa fa-thumbs-o-down"></i> Dislike (<cms:show_votes 'my_vote'><cms:show count_down /></cms:show_votes>)
</button>
<cms:input type='hidden' name='tmp' />
</cms:form>
The view:
Hope this comes in handy to someone who wants to have the vote Up/Down without the "radio" button.
Regards,
GenXCoders