Streaming live at 10am (PST)

Adding rating widget to cms collection pages


#1

Hi

How do you get the code from http://rating-widget.com to show within a cms collection page so each page keeps its own unique rating? Thanks peeps


Here is my public share link: LINK
(how to access public share link)


#2

Hello @RoseWebStudio

I tried this and it is pretty straight forward:

Add the code to the page template where you need the rating widget before the body

<script type="text/javascript">(function(d, t, e, m){

// Async Rating-Widget initialization.
window.RW_Async_Init = function(){
            
    RW.init({
        huid: "**Your HUID**",
        uid: "**Your UID**",
        options: { "style": "oxygen" } 
    });
    RW.render();
};
    // Append Rating-Widget JavaScript library.
var rw, s = d.getElementsByTagName(e)[0], id = "rw-js",
    l = d.location, ck = "Y" + t.getFullYear() + 
    "M" + t.getMonth() + "D" + t.getDate(), p = l.protocol,
    f = ((l.search.indexOf("DBG=") > -1) ? "" : ".min"),
    a = ("https:" == p ? "secure." + m + "js/" : "js." + m);
if (d.getElementById(id)) return;              
rw = d.createElement(e);
rw.id = id; rw.async = true; rw.type = "text/javascript";
rw.src = p + "//" + a + "external" + f + ".js?ck=" + ck;
s.parentNode.insertBefore(rw, s);
}(document, new Date(), "script", "rating-widget.com/"));</script>

and then add an embed code element and paste the following into it:

<div class="rw-ui-container"></div>

Once you’ve done this every page in your collection will have it’s own rating widget.


#3

It works, thanks. Didn’t when I tried it first of all. You must have special powers. Nice one


#4

Haha, no problem @RoseWebStudio I’m glad I could help. :smiley: