Loading...
 
Skip to main content

Features / Usability


Facebook like button

Has anyone been able to get the code for the facebook like button to work? I have tried both the XFBML version and the iframe version without success. The iframe version works in the preview, but not when the page is saved. I tried using the iframe and javascript plugins as well, without success, but perhaps I wasn't using them correctly. Do we have to do anything to initiate the JavaScript SDK? I even tried turning off the HTML Purifier, but that didn't help.

I am using tiki 6.1.

Here is the link to the facebook code page for the like button:
http://developers.facebook.com/docs/reference/plugins/likeQuestion

p.s. I already registered my site with facebook and received a facebook application ID and all that, but it is preferrable to have a generic like button on a page than to hope individual users will turn on the facebook integration from their personal accounts. That's a reason I want to be able to use the code from the link above. Also, I'd like people who aren't registered on my site to be able to "like' it.

Thanks for your help.

Simply create the button using the code page... you'll get some IFRAME coding.

Then add that code to the wiki page on which you want to have the button, using the IFRAME plugin, as I've done here.

Copy to clipboard
{IFRAME(name="fblike",title="fblikebutton",width="450",height="80",frameborder="0",marginheight="0",marginwidth="0",scrolling="no",src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ftiki.org&layout=standard&show_faces=true&width=450&action=like&font=arial&colorscheme=light&height=80")}{IFRAME}



Or you could put it in a module. See the docsQuestion for details.

Or you could put in the custom code areas of the Admin: Look & Feel page. See the docsQuestion for details.


HTH,

- RickQuestion | My Tiki Blog | My Tiki UserPage

Now Available: Tiki EssentialsQuestion, the #1 (and only) book for Tiki! Learn more...Question

Need more help? Try Tiki for Dummies SmartiesQuestion: A beginner's guide and Tiki EssentialsQuestion: What all Smarties need to know about Tiki Wiki CMS Groupware.

Rick,

Thank you. I have a few follow up questions — and an observation (for others who might read this)

Firs__t, the questions:

1.__ Will what you desrcribed work with XFBML version of the coding using maybe the javascript plugin?

2. Is there coding that can be inserted so that the url that is "liked" will be whatever the current page is? In other words, if I create a module and post it in a side column, I want the current page's url to be the url that is liked. Or if I were to create a wiki template with the coding that is used whenever a user creates a new wiki page, I'd want the current page's url to be used in the code. I know this can be done with wordpress, so I figure we ought to be able to do it with tiki as well. Although, if we can use the XFBML code, maybe we don't need any additional coding.

Some instructions that might be be adapted to tiki can be found at http://highedwebtech.com/2010/04/22/how-to-add-facebooks-like-button-to-any-page-on-your-site/Question

(I tried to include the relevant lines in here using first the CODE and then the LITERAL plugin tags, but much of the code was still stripped out.) Perhaps Tiki has something more elegant for doing this.

Now the observation:
First I used he WYSIWYG editor, changing the "tiki.org" in Rick's code to my site's URL, and pasting the line of code into the wiki page. This kept causing the site to show my own site in the iframe. Finally I switched to Source and it looked like tiki was inserting an extra "}" after the code which was messing up the rendering. I removed that and the code worked.

Alternatively, I tried pasting the code in the wiki page using the wiki editor and the code worked fine.

>
>1.__ Will what you desrcribed work with XFBML version of the coding using maybe the javascript plugin?
>

Sorry, I'm not familiar with XFBML. 😑

>
>2. Is there coding that can be inserted so that the url that is "liked" will be whatever the current page
>

Yes. You can use the Smarty syntax {$page} to get the current page name. An alternative is to use the custom code areas in the Admin Look & Feel page (as I've done on Tiki EssentialsQuestion).

The http://themes.tiki.org/Template+TricksQuestion page has some good examples you might want to explore.


HTH,

- RickQuestion | My Tiki Blog | My Tiki UserPage

Now Available: Tiki EssentialsQuestion, the #1 (and only) book for Tiki! Learn more...Question

Need more help? Try Tiki for Dummies SmartiesQuestion: A beginner's guide and Tiki EssentialsQuestion: What all Smarties need to know about Tiki Wiki CMS Groupware.

How is the {$page} used in the Iframe example you gave:

Copy to clipboard
{IFRAME(name="fblike",title="fblikebutton",width="450",height="80",frameborder="0",marginheight="0",marginwidth="0",scrolling="no",src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ftiki.org&layout=standard&show_faces=true&width=450&action=like&font=arial&colorscheme=light&height=80")}{IFRAME}


I tried putting it in there and it didn't work.

Is it something like:

Copy to clipboard
{IFRAME(name="fblike",title="fblikebutton",width="450",height="80",frameborder="0",marginheight="0",marginwidth="0",scrolling="no",src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.promotethegood.com/{$page}&layout=standard&show_faces=true&width=450&action=like&font=arial&colorscheme=light&height=80")}{IFRAME}


I'd like to place the code in a template so that any page based on the template will automatically have a like button that likes that specific page.

Note: The example I gave above creates a valid "like" button that works. However, it reads "{$page}" literally and doesn't insert that actual page into the link. How do I fix this? Help.

Hi Rick. Thanks for the info - I've got this working on my site. Note that {$page} is not URL encoded, so it won't work as-is for many pages. This does the trick:
{$page|urlencode}