Does anyone here know how to make a like button? What the code would be for that? Thank you.
Hi Manny,
Since this is a very high level question, I’ll take it with some high level design answer:
Assume you want to ‘like’ a page on you site, and that you are mapping a ‘like’ to a user email.
So, you need to have a like button, that upon clicking it, gets the page name (using wixLocation.path ).
Then, you need to store that information in a database.
You need to decide what kind of schema your database will have…
Will it be:
EMAIL LIKES
example@example.com “[‘page1’, ‘page2’, ‘page3’]”
It can also bee:
EMAIL PAGE-LIKED
example@example.com ‘page1’
example@example.com ‘page2’
example@example.com ‘page3’
Then you’ll need to read it, etc.
Hope this will get you started.
Liran.
formerly I used the “vote for star” more with the arrival of the wix code it has become obsolete since it does not synchronize and updates as the dynamic page changes item.
This is the html code:
<script type="text/javascript">(function(d, t, e, m){
// Async Rating-Widget initialization.
window.RW_Async_Init = function(){
RW.init({
huid: "334919",
uid: "28eb05a0b5ae7855f3e947b9a86e65b5",
source: "website",
options: {
"advanced": {
"layout": {
"lineHeight": "12px"
},
"star": {
"stars": 6
},
"font": {
"hover": {
"color": "#CEC5C6"
},
"size": "10px",
"color": "#CEC5C6"
}
},
"label": {
"background": "#493C3D"
},
"lng": "pt",
"style": "oxygen",
"isDummy": false
}
});
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><script type="text/javascript">(function(d, t, e, m){
// Async Rating-Widget initialization.
window.RW_Async_Init = function(){
RW.init({
huid: "334919",
uid: "28eb05a0b5ae7855f3e947b9a86e65b5",
source: "website",
options: {
"advanced": {
"layout": {
"align": {
"hor": "center",
"ver": "top"
},
"lineHeight": "12px"
},
"star": {
"stars": 6
},
"font": {
"hover": {
"color": "#CEC5C6"
},
"size": "10px",
"color": "#CEC5C6"
}
},
"size": "medium",
"label": {
"background": "#493C3D"
},
"lng": "pt",
"style": "oxygen",
"isDummy": false
}
});
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>
<div class="rw-ui-container" data-title="deadpool"></div>
looks like this:
miss you ;-;
I understand what you guys are saying but what I’m trying to achieve here is a “LIKE” button using repeaters. Maybe I wasn’t clear enough and I apologize for that. I’m using a repeater to display comments and I want the logged in user to be able to “like” whatever comment appeals to them. I’ve tried all sorts of things and I’m out of luck. Help! Thank you.
nerd bump
Did you ever find a solution to this? I’m trying to do the exact same thing currently as im building a social media style section to my site
I second the nerd bump…