How to Add Facebook's XFBML Like Button to content within a page

Author Message

Andy Woods

Wednesday 29 June 2011 10:16:25 am

I need to add Facebook's 'Like' button to a paragraph within one of my site's pages.

The code to insert is:

<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="www.usincare.org.uk" send="false" width="450" show_faces="true" font=""></fb:like>

Can you tell me how I can do this please?

Thanks,

Andy

Marko Žmak

Wednesday 29 June 2011 2:57:50 pm

Very simple:

  • identify the template which is used to show this page
  • insert the code you mentioned in this template on the apropriate place

Is ths what you were looking for?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Andy Woods

Wednesday 29 June 2011 11:39:34 pm

Hi Marko,

No - I don't think that will help me.

I want to insert the 'Like' button in the middle of a page of content.

Andy

Marko Žmak

Thursday 30 June 2011 12:32:05 am

So I supose you want to insert the like button inside the online editor field?

There are two ways of doing it...

a) embeded object

You create a new class called "HTML Box" which will have a "Text block" attribute and will be used to insert custom html. Then by using the embeded view for this class it can be used to insert any custom html inside online editor.

b) custom tag

Create a custom tag that will display the desired HTML based on the attributes of the custom tag.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Andy Woods

Thursday 30 June 2011 10:26:00 am

Thanks Marko,

I couldn't get the embeded object to work but the custom tag option worked fine.

Thanks again,

Andy

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 01:14:59
Script start
Timing: Jan 18 2025 01:14:59
Module start 'layout'
Timing: Jan 18 2025 01:14:59
Module start 'content'
Timing: Jan 18 2025 01:15:00
Module end 'content'
Timing: Jan 18 2025 01:15:00
Script end

Main resources:

Total runtime1.3825 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.2031152.6563
Module start 'layout' 0.00690.0037 740.859439.5000
Module start 'content' 0.01071.3704 780.3594562.2734
Module end 'content' 1.38100.0014 1,342.632812.0938
Script end 1.3825  1,354.7266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2346160.0002
Check MTime0.00120.0898160.0001
Mysql Total
Database connection0.00080.054310.0008
Mysqli_queries1.321895.6084630.0210
Looping result0.00070.0535610.0000
Template Total1.338796.820.6694
Template load0.00190.137320.0009
Template processing1.336896.694020.6684
Template load and register function0.00020.016010.0002
states
state_id_array0.00140.103910.0014
state_identifier_array0.00160.112820.0008
Override
Cache load0.00160.1159360.0000
Sytem overhead
Fetch class attribute can translate value0.00090.064220.0004
Fetch class attribute name0.00150.105260.0002
XML
Image XML parsing0.00060.044020.0003
class_abstraction
Instantiating content class attribute0.00000.001570.0000
General
dbfile0.00070.0490180.0000
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
2content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs