Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
Hi,

I'd like to put a facebook like button on all my blog posts. I can't get it to work properly.

The code for the button I am currently using is:
Code: Select all
<iframe src="http://www.facebook.com/plugins/like.php?app_id=167942629950628&amp;href=<cms:show k_site_link />/blog/<cms:show k_page_title />&amp;send=false&amp;layout=button_count&amp;width=50&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:21px;" allowTransparency="true"></iframe>


I thought this would work in theory, but when I like a blog post the link on facebook is wrong. The link to one of my individual blog posts is: http://http://agoberg.tv/blog/film_prod ... jects.html , but on facebook the link that comes up is: http://agoberg.tv//blog/Screen from upcoming projects (without the dashes and the .html extension)

I have enabled prettyurls so that might be a problem, but I was hoping it would be possible to tweak it somehow. Any ideas on how code this correctly?
Hi,

Why don't you simply use the k_page_link variable instead? That contains your current page's URL.
The revised code would become -
Code: Select all
<iframe src="http://www.facebook.com/plugins/like.php?app_id=167942629950628&amp;href=<cms:show k_page_link/>&amp;send=false&amp;layout=button_count&amp;width=50&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:21px;" allowTransparency="true"></iframe>


Hope this helps.
2 posts Page 1 of 1