Facebook like/comment box URL

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
eddyR3
Forum Members
Forum Members
Posts: 52
Joined: Tue May 14, 2013 6:51 am

Facebook like/comment box URL

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Facebook like/comment box URL

Post 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.
eddyR3
Forum Members
Forum Members
Posts: 52
Joined: Tue May 14, 2013 6:51 am

Re: Facebook like/comment box URL

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Facebook like/comment box URL

Post 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.
eddyR3
Forum Members
Forum Members
Posts: 52
Joined: Tue May 14, 2013 6:51 am

Re: Facebook like/comment box URL

Post by eddyR3 »

but wouldnt $page_alias need to be set for each page? :)
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Facebook like/comment box URL

Post by velden »

No, it's a variable that should be there already.
JohnnyB
Dev Team Member
Dev Team Member
Posts: 731
Joined: Tue Nov 21, 2006 5:05 pm

Re: Facebook like/comment box URL

Post 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}
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
Post Reply

Return to “Modules/Add-Ons”