Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Facebook Like box


Reply


3 Posts   457 Views

Avatar
bones

Community Member, 104 Posts

11 July 2013 at 12:06am

This is bizarre. I've put FB Like boxes on loads website (Silverstripe and others), but I just can't get this one to work!

I'm using the standard HTML5 Like Box (obtained from here: https://developers.facebook.com/docs/reference/plugins/like/ ), and inserted the Javascript right after the opening <body> tag and the plugin code elsewhere in the body.

However, all I end up with on pages is a pink box with the following:

This page contains the following errors:
error on line 20 at column 62: EntityRef: expecting ';'
Below is a rendering of the page up to the first error.

Line 20 seems to be

js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=285581704824865";

This is the first website where I've used SS 2.4.10. Could this be part of the problem?

Thanks

Avatar
Willr

Forum Moderator, 5513 Posts

12 July 2013 at 6:58pm

Is your Page using an HTML5 doctype?

Avatar
bones

Community Member, 104 Posts

12 July 2013 at 8:33pm

Hi Willr

Thanks for your reply.

It turns out to be an error in the code generated by Facebook.

The 6th line generated was:

js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=285581704824865";


However, the ampersand needed to be changed to &amp;. Once that was done, it worked fine :)