开发者

Facebook likebox script for websites

开发者 https://www.devze.com 2023-04-12 00:30 出处:网络
I have used the script provided for the likebox to create a user macro for my clients Confluence system.

I have used the script provided for the likebox to create a user macro for my clients Confluence system.

<script src="http://connect.facebook.net/en_US/all.js#x fbml=1"></script>`

<fb:like-box
  href="http://www.facebook.com/pages/Canada-YMCA-Federal-Government-Youth-Internships/215740255103118"
  show_faces="true" stream="true"
  header="true">
</fb:like-box>

My client is planning on upgrading to Confluence 4.0. Connfluence 4.0 has made a lot of changes with their macros and uses xhtml instead of wiki markup. I have upgraded my own version of Confluence to 4.0 and I am getting the following error on the page that I inserted the facebook-likebox macro on:

Error rendering macro开发者_如何学运维 'facebook-likebox' : Failed to transform the HTML macro template for display.

Nested message: The XML content could not be parsed. There is a problem at line 11, column 161.

Parser message: Undeclared namespace prefix "fb" at [row,col {unknown-source}]: [11,161]

It is a problem with the script here and the html character entities.

When I navigate to http://connect.facebook.net/en_US/all.js#x I see the JavaScript. Is this the full script for the likebox? If I have the the full script I may be able to make the necessary changes.

Could I get some feedback on this?


I'm not familiar with Confluence, so not sure how to change this in your setup (maybe someone else will know) but you need to tell Confluence about the fb and og prefixes Facebook uses for the XFBML elements in the Social Plugins and some of the Open Graph meta tags

In a standard HTML page this is done with

  <html xmlns="http://www.w3.org/1999/xhtml"
              xmlns:og="http://ogp.me/ns#"
              xmlns:fb="https://www.facebook.com/2008/fbml">

if you can't get this to play nicely with your configuration, most of the Facebook social plugins also have a HTML5 or iframe version which won't require use of 'fb' tags (like the <fb:like-box>' tag which the Javascript SDK replaces with the Like Box iframe)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号