To install single rating widget on your website you need to copy and past widget code where you want to display the rating.
The standard rating widget code is as follows:
Where:
To get this widget code Sign Up and registered your site then go to menu Rating - Install.
Also you can set method of voting at Rating - Setting menu. Available voting methods: Social, IP, Browser (Cookie).
To install several rating widgets on the same page you need to add wpac-rating class to each root DOM elements and data-wpac-chan attribute to definition the channel to link ratings with your web content (page, photo, product, etc...). For example place four rating widgets:
Run example:
Rating widget can initialize dynamically using the WPac.init({...})
function.
Run example:
To change default HTML template of rating widget add html parameter to wpac_init var.
Default HTML template is:
{{?it.count>0}}{{=it.rating}}{{?}} {{=it.stars}} {{?it.count>0}}{{=it.count}} {{=it.votes}}{{?}}
.
We use doT.js as template engine to more information look at
doT.js manual.
Where:
Examples for template {{=it.stars}} {{?it.count>0}}Rating: {{=it.rating}} based on {{=it.count}} votes{{?}}
:
Run example:
To change number of stars, color and star size add stars, color, size parameters to wpac_init var. Also instead wpac_init parameters you can use DOM element attributes: data-wpac-stars, data-wpac-color, data-wpac-size. DOM element attributes have a higher priority than wpac_init parameters.
Examples:
Run example: