With facebooks release of the universal ‘like’ button, several webmasters complained of an error on clicking the button. Probably, the way facebook read/parses the sites had changed since the sites complaining of this error also had a problem getting the thumbnails of their links and any meta data, to show up in their facebook posts. A user figured out why
http://forum.developers.facebook.com/viewtopic.php?pid=220462#p220462
you can see the complete thread at
http://www.vergegraphics.com/blog/joomla/77-facebook-like-button-module (Verge graphics joomla module for the ‘like’ button works really well)
NOTE: before you try the below please backup the originals…
Now to get rid of the spaces in a joomla template I had to
1) go to in my templates/templatename/html/mod_mainmenu/default.php.
Line 33&35…removed the space.
NOTE: Simply deleting the space did not work I had to put in ‘ ’ (for the geek in you-the entity used to represent a non-breaking space). So the lines looked like
$lspan = & $liFirstChild->addChild(‘span’, array(‘class’ => ‘l’));
$lspan->setData(‘ ’);
$rspan = & $liFirstChild->addChild(‘span’, array(‘class’ => ‘r’));
$rspan->setData(‘ ’);
2) Also had to change the space in the span “l” and “r” in functions.php (line 73) in the template root folder. Again I had to put in ` ’.
so it changed from
$result .= ‘<span><span> </span><span> </span>’
to
$result .= ‘<span><span> </span><span> </span>’
Now these files may not be in the same location in your case, you may have to hack the joomla core files in the module/mod_mainmenu/default.php. Its advisable, however, to copy the folders over to your template folder to create a template override
Hope this works for you as it did for us.
Note: if you are using word press…maybe header.php is the file to look at for the spaces in the spans?
Please feel free to enter any additions to the comments section…to help others, until facebook implements a fix.
Addition: See How Neth fixed the problem below…another probable solution if the above does not work for you.
- 5 Points to Consider For Your Next B2B SaaS Marketing Gig - February 12, 2022
- 3 Effective KPIs to Keep Your B2B SaaS Marketing Efforts Revenue Focussed - February 17, 2020
- 4 Contrarian Management Insights from Disney - February 2, 2020
I’ve tried your solution and literally eliminated every space between every span tag in my code. I even went over the source code output to verify there are no spaces but still am getting the “page could not be reached error”. This is really aggravating bug on behalf of Facebook.
Hi Neth,
I hear ya! I spent at least 50 hours on this unnecessary diversion.
Are you using sef components? WP or Joomla? Was it ever working? In my case, it was working and then stopped around the 18th of April (approx the time FB announced the universal like button)
Can you send me a link that displays the problem? There is something on the page that is causing facebook to choke.
All the best
I hope the code is visible in comments.
I have managed to fix the “Page could not be reached” issue as other solutions did not work for me.
Edit the code in default.php to reflect the following changes:
1)
function CurrentPageURL()
{
$pageURL = $_SERVER[‘HTTPS’] == ‘on’ ? ‘https://www.yourdomain.com’ : ‘http://www.yourdomain.com’;
$pageURL .= $_SERVER[‘PHP_SELF’];
return $pageURL;
}
2)replace
($params->get(‘autourl’) == ‘yes’ ? $url = CurrentPageURL() : $url = $params->get(‘url’));
with
($params->get(‘autourl’) == ‘yes’ ? $url = JURI::current() : $url = $params->get(‘url’));
worked like a charm on my site.
Thanks Neth…hope facebook fixes this mess and does not break anything else.
As for your question – I am using Joomla with Sh404sef and my solution applies to the verge extension. Seems like the problem is caused by 2 major reasons:
1. As you’ve stated- the space in spans.
2. Facebook not liking certain URL structures.
Thanks so much for the time and effort you have put into finding a solution to this problem. I did exactly what you did and it fixed it for me.
Thanks again.
Travis
Hi Travis, Thanks for taking the time to confirm that it worked. All the best.-Jacob
http://www.facebook.com/widgets/like.php?href=http://garagesale-syria.com
i tried it for other domains, and it worked for some!!!
The suggested solution removing the spaces did not work! 🙁
when removing the www from the domain name, the code acts differently?!
Hayan Al Mamoun
Hi Hayan,
I looked at the page source of your site and see spaces in the span class “l” and “r” within the span class=”art-button-wrapper”
You will have to get rid of those spaces too.
If I’m not mistaken you are using an artisteer template…you will probably find the span statements in a file in your template folder.
There maybe other spaces in the span on your page too…the above was the first one I came across.
Thank you for your instruction…but How I disable: facebook I Like show on frontpage..:-( I want only in articles..sry for my english..thank you
The most common way is to go into the module and disable it for specific menus… Go into the module and under ‘menu assignment’ select only the menus you want the module to appear in. Hope this helps.
p,s: you should go to the vergegraphics.com page and check with Max, he is very proactive in trying to help with his plugin
Hey, my two sites that aren’t working correctly are http://www.outonlimbs.com & http://www.smarkoutmoment.com and I cannot seem to figure out what the problem is.
Hi..I have been a bit tied up but will try to see if I can figure it out over the weekend. What platform are you using for the sites?
Both of them are Blogger
Hi I spent a little time but could not find the issue…am not very familiar with blogger. Someone wrote this about blogger “Possible solution for Blogger users:
In Blogger: turn Site-feed settings back to default.
Let me know if it helps.”
Hello,
Thanks for your hint. In my case only point 1 form your changes were necessary.
Thanks for the feedback Christian, its good to know it worked for you.
Hey, I am running into the same problem. I changed the thing to ” ” but I couldn’t find the in my functions thing. Any help would be appreciated. It works on “other” templates not the one I like though. 🙁
is this on joomla?
yes, it’s on joomla. I tried doing the “&nsbp” thing but it showed “&nsbp” on the top menu. I put a “.” and that fixed it for a little, but I’m running into trouble again. My latest article’s (beBlog) won’t work but everything else works.
Check also that your HTML is XHTML compliant.
I had a single stupid which broke it!
Changing to fixed it
the HTML my last email got stripped
i had a single BR tag without a closing /
adding the closing / to the BR tag fixed this problem. phew. simple
jsut put the whole document into an XML editor and validate it
wow. I have not heard of that before…thanks for the input though. Hope it helps others
I also have some problem. Unfortunatly it works on some sites but not on everyone.
The root adress always works but on some sites i get the error.
What can i do?
what did you try so far? WHat platform are you using?
I just tried to change the line 25 on default.php
($params->get(‘autourl’) == ‘yes’ ? $url = JURI::current() : $url = $params->get(‘url’));
and there we are. 🙂 thanks, now it looks fine to me
Thanks Andreas.
Mine is working on the front page news.vegyorkcity.com but on individual posts on distict URLs, it errors out
http://news.vegyorkcity.com/2010/05/sido-amazing-manhattan-middle-eastern.html
does not work
but the same post works, although it seems every button on every post is recommended by the same number of people.
It does work…I gave it a try
none of these solutions have worked, but for some reason it works when the site is offline? Any ideas?
Different template/layout is called when site is offline?
None of this works for me as I am running wordpress with the FACEBOOK SOCIAL PLUGINS and have this error.. I went to a bumch of other sites that also have this plugin and they TOO have the same issue.. how to fix?
No, it is not working. And your FB like button is not working too… I think that FB don’t want us to use this feature for some reason… that’s it.
Cheers,
S
The button works on this site so I’m not sure I understand.
Does the button work on here if the post has never been LIKED? if the post HAS been liked before, then the LIKE BUTTON works (at least on my site) but if its a new post, and no LIKES, it does NOT work… HELP! on the facebook BUG report, some people reported it was working again but its NOT for me….
Thanks Andreas.
This is now an officiel FB bug : http://bugs.developers.facebook.com/show_bug.cgi?id=10674
thank you so much. this works perfectly for me.
If you are running the Like button on a regular, non CRM powered website, I might have a solution for you. I just had this problem and after some experimentation I think I found the solution. I mean, I know I did, it works for me! I blogged about this so it’s easy to share. let me know if this might’ve worked for you too.
Cheers.
http://kirillzubovsky.com/2010/10/07/solution-to-facebook-open-graph-page-could-not-be-reached-problem-with-the-like-button/
Thanks for the add Krill. Hopefully, the collective wisdom can help others
not work as im using wordpress self hosted. please help
Hello,
Maybe its the theme? You could try using a default theme.If that does not work, try disabling the installed plugins one at a time. This could help narrow down to the issue.
I replaced all the whitespace between the tags with and it still doesnt work.
Url linter finds all of the pages except for virtuemart subpages (basket, categories, product details…). These are inaccesible to the linter.
Since im using the Like button only on my product details page it doesn’t work.
Og meta tags get generated only on virtuemart subpages.
Please check out my page source if you can find any problem.
I’m using Joomla 1.5.22., Virtuemart 1.1.6., template is made in Artisteer.
Also i can’t try Neth’s solution because i cant find the CurrentPageURL() function in default.php
Am i looking in the right spot (templatename/html/mod_mainmenu/default.php)?
Ok, I found out that if the url ends with “&vmcchk=1” everything works fine.
So I looked around a bit and found this:
http://forum.virtuemart.net/index.php?topic=44275.msg151545#msg151545
Apparently there’s some sort of an issue with VM cookie check. Making the modification found in the link above fixed the problem.
Hi Anze, That’s a tricky one. I have no virtuemart installations currently and would not have been of much assistance. Thanks for catching the issue and posting back. Much appreciated.
Hi,
I am using standard facebbok like button to our dynamic drupal web page. If i click the like button its like that page and it is showing error also. I dont know why that error is coming, I searched many web based tutorials but i could not able to rectify that error.
Please help me to solve this.
The errror i am getting is: The Page at (URL) could not be reached.
sample url of dynamic page: http://volunteerismdev.photoninfotech.com/node/25/Search
Thanks in advance.
Its very urgent issue. Please reply ASAP
Hi Dinesh, That link you provided seems to be down.
Thanks for your reply. now the problem is i want to share my webpage in facebook.
i can share only title and url but i couldn’t share with image thumbnail. why?
I had a similar issue. Once I left out the index.html in the link it worked fine.
Hope this will work
<fb:like href="” send=”true” show_faces=”false” action=”recommend” width=”50″ font=”segoe ui”>
works on my site http://gujarataddall.in
What worked for me was to change website url in the facebook code to https instead of http. For some reason after I did that everything worked. Then I changed it back to http and it still worked!
To be clear, I made it:
<iframe src="http://www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpagename
about to check if it works now, will let you know
Is it possible to get rid of the ” Facebook social plugin ” link from the module ?
Hi, You would have to check over at http://www.vergegraphics.com/. They are the ones who make the plugin and their forums may offer a solution.
The issue still persists!? Seems this is not specific to joomla or php!? I am still facing issues!
http://www.goanswered.com/index.php/95/facebook-send-button-gets-me-a-page-cannot-be-reached-error#.UDob96M0HtQ