Pages

Ads 468x60px

Showing posts with label facebook. Show all posts
Showing posts with label facebook. Show all posts

Thursday, July 31, 2014

SOLVED:'TEMPLATE ERROR: Invalid data reference post.canonicalurl: No dictionary named: 'post' in: ['blog', 'skin', 'view'] '

This error appeared on every individual post after adding facebook comments.

What was causing this was the facebook comments appearing twice in my xml.

<fb:comments colorscheme='light' expr:href='data:post.canonicalUrl' expr:title='data:post.title' expr:xid='data:post.id' width='600'/>

As well as...

<div class='fb-comments' data-type='button' expr:href='data:post.canonicalUrl' expr:title='data:post.title' expr:xid='data:post.id' locale='el_GR' width='600'/>

And this was causing a conflict.

So I removed the fb:comments and -problem solved.
Read more ...

Tuesday, March 25, 2014

big facebook share button

This piece of code creates huge share buttons on facebook like the one below.



1st part
First put this code in the head section of your template.

<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=567348686666720";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
2nd part
Then this piece in your body section.I have noticed that if I put the css (the code between the style tags) in the skin section this causes problem with the comments box.I have no idea why.



<div id='fb-root'/>
<style>
  .fb-share-button
{
transform: scale(3.5);
-ms-transform: scale(3.5);
-webkit-transform: scale(3.5);
-o-transform: scale(3.5);
-moz-transform: scale(3.5);
transform-origin: top left;
-ms-transform-origin: top left;
-webkit-transform-origin: top left;
-moz-transform-origin: top left;
-webkit-transform-origin: top left;
}
  </style>
3rd part
The third part goes to where ever you want your button to appear.You can put the second and third at the same place.


<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div class='fb-share-button' data-type='button' expr:href='data:post.canonicalUrl' expr:title='data:post.title' expr:xid='data:post.id'>
</div>
</b:if>
Tweaking
Change the numbers in pink for size.
The code in yellow changes the language of your button.


Known issues.
If you already got a facebook comments box in your blog this conlifcts with your big share/like button it may not show at all.A solution that works for me is to leave out the <script> part and the<div id='fb-root'>.This code already exists in the comments code so you don't need to paste it twice.
Read more ...
 

Sample text

Sample Text