Page 1 of 1
Facebook like/comment box URL
Posted: Fri Dec 06, 2013 10:25 am
by eddyR3
Hey guys, hope you are well, i have setup a like button and comment box on a page using Pretty URLs, the site page URL is this :
http://e-cig-reviews.com/silica-atomisers/rose-atomiser
If i click the like button, then visit my facebook and click the link from facebook i get this :
http://e-cig-reviews.com/silica-atomise ... map=%5B%5D
But as you can appreciate, this kills the URL and the page doesnt load the likes/comments that were previously there, but returning to the original URL it works fine. Whats going on? Any suggestions?
Many thanks,
Eddy
Re: Facebook like/comment box URL
Posted: Fri Dec 06, 2013 12:52 pm
by velden
Have a look a this code:
Code: Select all
<fb:like data-href=http://e-cig-reviews.com/silica-atomisers/rose-atomiser layout="button_count" action="like" show_faces="true" share="false" width="90" height="20" style="overflow: hidden;"></fb:like>
and note that the data-href value is NOT encloses in quotes.
Re: Facebook like/comment box URL
Posted: Fri Dec 06, 2013 12:59 pm
by eddyR3
Thanks for the reply!
Thats been corrected now, and the problem still remains
http://e-cig-reviews.com/genesis-atomis ... map=%5B%5D
Thats the URL that gets posted which isnt the correct link, or at least CMSMS doesnt part it correctly as the facebook likes/comments disapear on that link as opposed to the normal link
http://e-cig-reviews.com/genesis-atomisers/pegasus
Re: Facebook like/comment box URL
Posted: Fri Dec 06, 2013 1:08 pm
by velden
Yeah, I don't know how you get the url but it certainly is not the right way.
Use the canonical url of the page for both <meta property="og:url" as well as the Like button data-href.
{cms_selflink href=$page_alias} should work I guess.
Re: Facebook like/comment box URL
Posted: Fri Dec 06, 2013 1:52 pm
by eddyR3
but wouldnt $page_alias need to be set for each page?

Re: Facebook like/comment box URL
Posted: Fri Dec 06, 2013 1:53 pm
by velden
No, it's a variable that should be there already.
Re: Facebook like/comment box URL
Posted: Sat Dec 07, 2013 8:49 am
by JohnnyB
I don't think, the link showing,
Code: Select all
data-href="https://www.facebook.com/pages/E-Cig-Reviewscom/132140950190583?fref=ts"
is a problem because it is a link to Like your Facebook page, not share the web page.
But anyway, all that is needed is the "
https://www.facebook.com/pages/E-Cig-Re ... 0950190583" portion of the url. You might also consider setting a page name in your Facebook settings so the link to your facebook page is something simple like, "
https://www.facebook.com/E-Cig-Reviews.com"
Maybe this is relevant:
There could be an issue with the base href since there are two of them on the page: <base href="
http://e-cig-reviews.com/" /> and then a few lines below: <base href="/">
And, maybe you are missing this tag in your template's < header > because I don't see it being printed in the source:
Code: Select all
{if isset($canonical)}<link rel="canonical" href="{$canonical}">{elseif isset($content_obj)}<link rel="canonical" href="{$content_obj->GetURL()}">{/if}