Showing posts with label Template Hacks. Show all posts
Showing posts with label Template Hacks. Show all posts

Sunday, 14 February 2010

Add Google Buzz Buttons To Blogger Blog

Buzz It

google-buzz-buttons-for-blogger Google Buzz is a social tool from blogger and it is much similar to twitter and facebook :). Google Buzz is a new way to start conversations about the things you find interesting. You can read more about Google Buzz at the official Google Blog . You might have seen the Google Buzz buttons on Mashable. This one is similar but doesn’t produce any share count.

You can see a demo of this button in this post page. :) .

To get the Buzz button on your blog, posts follow these steps.

1. Login to your Blogger Account and navigate to Layout > Edit HTML and Expand your widget templates.

2. This is the Google Buzz it Code. Copy it. If you want to use some other Google buzz button image , then you can do that by changing the image link in the code [http://i48.tinypic.com/idyc04.png]

<div style="float:right;padding:4px;">
<a expr:href='&quot;http://www.google.com/reader/link?url=&quot; + data:post.url + &quot;&amp;title=&quot; + data:post.title + &quot;&amp;srcTitle=&quot; + data:blog.title+ &quot;&amp;srcURL=&quot; + data:blog.homepageUrl ' rel='nofolloW' style='text-decoration:none;' target='_blank'>
<img alt='Buzz It' src='http://i48.tinypic.com/idyc04.png' style='border:0px;'/></a>
</div>





3.Now find this piece of code in your template



<div class='post-header-line-1'/>

and immediately after that place our Google Buzz it  Code and you are done :)

If you were unable to find this code in your template,then look for the first occurrence of






<data:post.body/>



and immediately before that, place our Google Buzz it Code.



4.Save your template and see the results.

read more...

Wednesday, 10 February 2010

Add Signature to Blogger Blog

You might want to add a custom automatic signature below each of your blog posts. This would be more useful if you are running a Team Blog with multiple authors. You can use unique signatures for each author.The same can be done on a single author blog also :)

Adding Signature to Single Author / Multi Author Blogger Blogs

1. Create a Signature using Photoshop or some online Generators like My Live Signature

2. Upload this signature image to blogger.Once its uploaded hit preview and copy the image location(Note down the URL of the image).

3.Now Go to Layout > Edit HTML and Expand your Widget Templates

4.Now Find

<div class='post-footer-line post-footer-line-1'>



If you cant find it then try finding this one




<p class='post-footer-line post-footer-line-1'>



or this one




<data:post.body/>



a) If you are using a Single author blog, paste the following code below the code you found



<img src='url_of_your_signature_image' style='border:0px;'/>


Code should be edited with your signature image URL



b) If you are on a Team Blog, paste the following code just below the code you found



<b:if cond='data:post.author == &quot;Author1Name&quot;'>


<img src='url_of_author1_signature_image' style='border:0px;'/>


</b:if>


<b:if cond='data:post.author == &quot;Author2Name&quot;'>


<img src='url_of_author1_signature_image' style='border:0px;'/>


</b:if>


If you have more number of authors, you can repeat the blocks accordingly(here i have mentioned 2 blocks[blue and brown] one for each of the two authors).Codes should be edited with the author names and the signature image  urls.



5.Save your template and you should see the signature in action :)



signature

read more...

Friday, 22 January 2010

Blogger Pages are finally out

Blogger has now released the pages feature just like in Wordpress blogs. You can use these pages for about me, contact me etc. The blogger pages are more or less like the blogger posts. But these pages wont appear in the blog archives and the blog feeds.

How to create a Blogger Page?

1. Login to your Blogger Account

2. In the posting Tab you will find an Edit Pages optionimage

3.Click on the New Page button and you will get a new page editor(same as the post editor that you normally use)image

4.You can make the page, in the same way as you create a post.If you want to enable commenting on the page, then you can do so from the post options

image

5. When you hit the Save And Publish Page button, you will be asked if you would like to add the Page Gadgets onto your blog

image

You can add the page gadget on the sidebar or as Top navigation Tabs.These widgets may not properly sync with your blog template.So i would advise you to choose the No Gadget option and add the links manually to your blogger template. You can obtain the links to the newly created pages from the Edit Pages Tab.

If you opt to add any of Pages gadget, then you will get an easy interface to add the page links to your blog. (now available on draft.blogger.com only) Here is what the Gadget options will look like

image

 

Limitations

1. You can only create a maximum of 10 pages.

2. Separate templating for pages would be a little too difficult(but not impossible :) )

Advanced options.

If you are familiar with the usage of blogger’s conditional tags and want to do something special with the pages, then you can use the following conditional tag for that

<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
When condition is true this will be done
</b:if >

eg: If you want to hide the sidebar on the Static Pages, then you can use these conditional tags properly to implement that

Here is the incomplete sample code for the same

<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
<style type="text/css">
.sidebar-wrapper{display:none;}
</style>
</b:if >

This code should be placed above </head> in your template.

you will have to add some more CSS definitions to make it complete(you should increase the width of the post area.. ) these will be different from template to template. So  you will have to figure it out :)

So are some of my Blogger Pages. – Subscribe , Contact Me

Misbehaviour

1. If you are using the automatic post summaries hack, then your pages might not be properly displayed. I have updated the Automatic Post Summaries Trick so that it does not conflict with the static pages. So if you are using an older version of this trick, then do update

2. If you are using some trick to hide the post contents on non-post pages,then also you might end up with  problems on your new Static Blogger Page. You can either undo the trick or update the codes properly to avoid conflicts :)

read more...

Wednesday, 28 October 2009

Facebook Share Count Buttons For Blogger

Facebook has now officially introduced the Retweet like buttons for your blogs or sites. These buttons look much similar to the Retweet buttons by Tweetmeme. Facebook has 5 styles of Sharing buttons. Here we will see two of them.

Adding a Facebook share count button will show a neat count of how many times your blog post has been shared on Facebook.

Facebook Share Button Style 1

facebook-share-button-for-blogger-1

Code for Facebook Share Button Style 1

<div style="float:right;padding:4px;">
<a expr:share_url='data:post.url' name='fb_share' rel='nofollow' type='box_count'/>
<script type="text/javascript" src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"/>
</div>



Facebook Share Button Style 2



facebook-share-button-for-blogger-2



Code for Facebook Share Button Style 2




<div style="float:left;padding:4px;">
<a expr:share_url='data:post.url' name='fb_share' rel='nofollow' type='box_count'/>
<script type="text/javascript" src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"/>
</div>



Facebook Share Button Compact Style 1



facebook-share-button-for-blogger-3



Code for Facebook Share Compact Button Style 1




<div style="float:right;padding:4px;">
<a expr:share_url='data:post.url' name='fb_share' rel='nofollow' type='button_count'/>
<script type="text/javascript" src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"/>
</div>



Facebook Share Button Compact Style 2






facebook-share-button-for-blogger-4



Code for Facebook Share Compact Button Style 2




<div style="float:left;padding:4px;">
<a expr:share_url='data:post.url' name='fb_share' rel='nofollow' type='button_count'/>
<script type="text/javascript" src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"/>
</div>





How to install Facebook Share Count Button on your Blogger Blog?



1.Select one of the Share Button Styles and copy the Corresponding Code.



2.Now login to your Blogger Dashboard and navigate to Layout > Edit Html and expand the widget templates



3.Find this piece of code



<div class='post-header-line-1'/>

and immediately after that place our Facebook share button code(that you copied)

If you were unable to find this code in your template,then look for the first occurance of






<data:post.body/>



and immediately before that paste our Facebook Share button code(that you copied).



5.Save the template and you should get a facebook share count button near each of your blog posts.


If you liked this post and if it helped you in implementing the facebook buttons, then please consider sharing this post on Facebook using the button on the top-right of the post :)


Link: Additional Share Button Styles on the Facebook Developers Wiki



Permalink :Facebook Share Count Buttons for Blogger

read more...

Thursday, 17 September 2009

Show avatars on Blogger Comments

Blogger is now introducing features every day as part of its 10th birthday celebrations.Now it has formally announced the Blogger Comment avatars. To know what it means take a look at the comments here on this blog and you will see the profiles pictures of the commentators near to the comments.If you are using some default blogger template things would be much easy.Here is a little screenshot of the new feature.

Implementation of Comment Avatars

1.First of all Go to Blogger > Settings >Comments and enable “Show profile images on comment”

2.Now if you have a normal un customized template you will see the avatars on the comments on your blog.

3.If you have a customized template you will have to add some codes and play around with your template.For that first go to Blogger Layout >Edit HTML and backup your template.

4.Expand the widget templates and check if you can find this line there

<dl expr:class='data:post.avatarIndentClass' id='comments-block'>



If you can’t then that means we have something to do..



If you couldn’t find this,then do the following steps.



a)Find




<dl id='comments-block'>



and replace it with




<dl expr:class='data:post.avatarIndentClass' id='comments-block'>



b)Now Find all occurrences of




<a expr:name='data:comment.anchorName'/>



and replace each of it with




<b:if cond='data:comment.favicon'>
<img expr:src='data:comment.favicon' height='16px' style='margin-bottom:-2px;' width='16px'/>
</b:if>
<a expr:name='data:comment.anchorName'/>
<b:if cond='data:blog.enabledCommentProfileImages'>
<div expr:class='data:comment.avatarContainerClass'>
<data:comment.authorAvatarImage/>
</div>
</b:if>



If you are using the author comment highlighting trick and if doesn’t work out with that trick,then leave a comment and i will try to help you out..



Further Styling.







If you want to add a default avatar for the ones with no profile pics,then place the CSS code just above




]]></b:skin>



CSS Code




.avatar-image-container {background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjrNZkaSGAeP7wfh1UzHXXWNnli1Q4KkssTSGnX0Pzrc-JBi1hV8_cmbPo6ArzrkQxwGckNM8IHQ3b3SfcYHBLwchWdTgLZxSgfq2z6QBIQCYhPZu6cR-Gpm28UvUSHYNJFTjI9_3fug/s400/default.gif); width:35px;height:35px; }
.avatar-image-container img { border:none;}



You can customize the CSS according to what you need.



If you need bigger avatars instead of smaller ones,then use the following CSS instead of the one above.




.avatar-image-container{width:50px;height:50px;margin-top:-5px;}
.avatar-image-container img {background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuerQ3UmmeTPwkWEA4m90FPpidUTDsp2NH5zsdmkECpdMzaQmzLqqKI8BmFIwUxc1y6EM1adiwBTgaVWH1Fauq4vM90f1uSxf7lUfjDWRe5mt42uiPKL0gv_bq1-G34BwfuJhPdfjg7FE/s400/grav.png);width:50px;height:50px;}



This will give you a bigger avatar and also a default gravatar image but it has a little drawback.It will also resize the small blogger favicons to a big size.(blooger favicon is displayed when a blogger user doesn’t have a profile avatar.Similarly OpenId also has a similar small icon.. ).



BTW to set you avatar pic you can use two methods.You can choose the edit profile link on your blogger profile and upload an image there,The second method is to enter a blogger comment somewhere in any blogger comment form and then click the Preview button instead of the Post Comment button.Now you will see an option to upload your avatar.



In case anything bad happens restore the template backup.. and comment here..:)


Permalink: Show avatars on Blogger Comments

read more...

Numbered Page Navigation For Blogger

Page Navigation is a really awesome and long awaited feature. You might have seen numbered page navigation on many wordpress blogs(wp-pagenavi by Lester Chan). Muhammad Rias of Techie Blogger had already developed a page navigation system for blogger.It really was an awesome trick which was made at a time when nobody could even think of implementing it on blogger.It had some minor bugs and now Abu Farhan has perfected it and he has now given us the perfect page navigation solution.Here is a little screenshot of what this is all about. blogger page navigation

When you use this hack,you will see this kind of navigation on your blog’s home page and label pages(needs little customization).

Implementation of Blogger Page Navigation

Those who are bad at HTML modifications can use my one click installer :)

Add Recent Posts Widget 

After installing this widget proceed to the label fix.

The Complex Method. :P

If you installed the widget you shouldn’t be here.. Scroll down to the label fix.

1.Login to Blogger Dashboard and navigate to Layout > Edit Html

2.Don’t click the checkbox which says ‘Expand Widget Templates’

3.Now find

]]></b:skin>



and replace it with






.showpageArea a {
text-decoration:underline;
}
.showpageNum a {
text-decoration:none;
border: 1px solid #cccccc;
margin:0 3px;
padding:3px;
}
.showpageNum a:hover {
border: 1px solid #cccccc;
background-color:#cccccc;
}
.showpagePoint {
color:#333;
text-decoration:none;
border: 1px solid #cccccc;
background: #cccccc;
margin:0 3px;
padding:3px;
}
.showpageOf {
text-decoration:none;
padding:3px;
margin: 0 3px 0 0;
}
.showpage a {
text-decoration:none;
border: 1px solid #cccccc;
padding:3px;
}
.showpage a:hover {
text-decoration:none;
}
.showpageNum a:link,.showpage a:link {
text-decoration:none;
color:#333333;
}
]]></b:skin>



This is the CSS part which defines the look and feel of the page navigation.You can modify it according to your need



4.Next is the JavaScript part. Find



</body>


and replace it with




<!--Page Navigation Starts-->
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<script type='text/javascript'>
var pageCount=5;
var displayPageNum=5;
var upPageWord =&#39;Previous&#39;;
var downPageWord =&#39;Next&#39;;
</script>
<script src='http://blogergadgets.googlecode.com/files/blogger-page-navi.v1.js' type='text/javascript'/>
</b:if>
</b:if>
<!--Page Navigation Ends -->
</body>



As you can see,there are some customizable parameters in this code



var pageCount=5;


This code determines the number of posts that would be displayed per page.



var displayPageNum=5;


This code determines the number of additional page navigation numbers that will be displayed on the page.



var upPageWord =&#39;Previous&#39;;
var downPageWord =&#39;Next&#39;;


These two lines determine the text that would be shown for the previous page and next page respectively.




Label Fix



Now we have another problem.By default,the blogger label pages will show 20 posts.We will have to cut this down to the value that we gave for the variable pageCount (or the posts per page).For this we will have to edit our template





How to Edit the template to cut short the posts per page?



Go to the Edit HTML page and expand the Widget Templates



Now find each occurrence of



'data:label.url'


(including the quotes) and replace each of it with



'data:label.url + &quot;?&amp;max-results=5&quot;'


Here 5 is the number of posts to be displayed per page.



Now if you are using the label cloud widget by phydeaux3,then find



a.href = &#39;/search/label/&#39;+encodeURIComponent(t);


and replace it with




a.href = &#39;/search/label/&#39;+encodeURIComponent(t)+&#39;?&amp;max-results=5&#39;;



 



Here also 5 is the number of posts to be displayed per page.



Now you should have the Blogger Page Navigation working perfectly on your blog. :)



This tutorial is based on Codes from Abu Farhan and Muhammad Rias. So if you plan to write this tutorial on your blog,do link back to them also.



Permalink: Numbered Page Navigation For Blogger



read more...

Thursday, 10 September 2009

Post Summaries on Blogger With Read More

Blogger is fulfilling some of our expectations. Now blogger officially supports Post Summaries With Read more.This means that you wont need any JavaScript and CSS based tricks to display post summaries on Non-Post Pages.The static pages would be out soon. A screenshot on the official blogger buzz blog has made it more clear.

How Does This Work

Blogger has introduced something called jump breaks. This will help you in creating the summary.

What is a jump break? - Jump break is a special tag which can be inserted anywhere in a post using the post editor.When you have inserted a jump break into a post, the portion of the post above(or before) the jump break will serve as the summary of the post. This means that only this smaller portion will be displayed on Non-post pages.

How to insert a jump break?

If you are using the New Advanced Post Editor, then you can insert the jump break easily from the post editor.

If you are not using the New Post editor,then you will have to manually type the jump break tag . To do that just place <!-- more --> [Note that there is a space before and after more.] at the position where you want the break to occur. Now try going to your home page,and only the summary would be displayed on the home page.You might get problems if you are using a modified and highly customized template. In that case try the following adjustments. Go to your Blogger Layout > Edit HTML and expand the Widget templates. Now check if the following code is already present in your template
    <b:if cond='data:post.hasJumpLink'>
<div class='jump-link'>
<a expr:href='data:post.url + &quot;#more&quot;'><data:post.jumpText/></a>
</div>
</b:if>



If this code is not present in your template,then add this code before




<div class='post-footer'>


Now it should work properly.. If it doesn't,then leave a comment here and i will try to help you out..

Changing the Read More Text



By default the read more link text is Read more »  . You can change this to whatever you like. To do that, Go to Blogger Layout and click on the Edit link on the Blog Posts Widget.



image



Change the Post Page Link Text and Save the Settings..



Drawbacks of the New Feature





For the post summaries to work effectively, you have to edit each of your posts and add the jump link in each of them. Blogger wont generate summaries automatically.:(



A mistake that you might make.



When you insert a jump break in the post,the part of the post after the jump break gets truncated. In your posts,there are some opening div tags before the jump break and some of these are closed after the jump break. So when blogger truncates the part of the post after the jump break,the closing div gets missing. That's why the sidebar shifts to the bottom.



So in order to solve this you should take some care in inserting the jump break.The jump break shouldn't be inserted into open tags..



For example something like this shouldn't happen.(You can see these things if you switch to Edit HTML instead of Compose)



<div>

This is the short summary


<!-- more -->


This is the rest of the post


</div>



As it is clear from this code, the jump break is inserted into an open div tag and the div is closed after the jump break.This should not happen.You should insert jump breaks after closing the div tag..



So this should look like



<div>

This is the short summary


</div>


<!-- more -->


This is the rest of the post



I hope that the blogger post editor will soon show warnings when the jump break is inserted into open tags.


Permalink:Post Summaries on Blogger With Read More

read more...

Tuesday, 25 August 2009

Blogger Releases the new version of the Label Widget

Blogger,as a part of its 10th Birthday celebrations, has now released a new version of the label gadget.This one is much better that the old version

What is new?

  1. It comes with a Label Cloud.
  2. It lets you choose which labels are to be displayed.
  3. You can customize it further using CSS.

Drawbacks

  1. The cloud just has 5 variations.All labels will be divided into 5 classes depending on the usage of these labels.
  2. It would have been better if there was a bigger number of classes.

How to Customize?

You can customize the looks further by using CSS..As i said it has 5 classes of clouds..You can add CSS styles to each of them.

Here is a sample Style which will give a bluish look for the cloud..Here i have applied styles for all 5 label classes and their hover styles (so 10 style definitions in total).

.label-size-5 a {color: #2789ce; /*color of a label of class 5*/
font-size: 3em;
text-decoration: none;
}
.label-size-5 a:hover {color: #2789ce; /*color of a label of class 5 on hover*/
text-decoration: underline;
}
.label-size-4 a {color: #2789ce;/*color of a label of class 4*/
font-size: 2.5em;
text-decoration: none;
}
.label-size-4 a:hover {color: #2789ce;/*color of a label of class 4 on hover*/
text-decoration: underline;
}
.label-size-3 a {color: #2789ce;/*color of a label of class 3*/
font-size: 2em;
text-decoration: none;
}
.label-size-3 a:hover {color: #2789ce; /*color of a label of class 3 on hover*/
text-decoration: underline;
}
.label-size-2 a {color: #2789ce;/*color of a label of class 2*/
font-size: 1.5em;
text-decoration: none;
}
.label-size-2 a:hover {color: #2789ce; /*color of a label of class 2 on hover*/
text-decoration: underline;
}
.label-size-1 a {color: #2789ce;/*color of a label of class 1*/
font-size: 1em;
text-decoration: none;
}
.label-size-1 a:hover {color: #2789ce; /*color of a label of class 1 on hover*/
text-decoration: underline;
}



Here all of these CSS styles are customizable.You can change the colours and font sizes of each of the 5 classes.








color: #2789ce; is responsible for the colouring of each of the classes.You can change it appropriately with some other hex colour code or something like color:red;



You can adjust the font size of these 5 classes by adjusting the corresponding font-size: attribute of that label size class.. (em is a unit of font size just like px)



I have commented the css codes(10 comments)..You can remove those comments if you want(eg: /*color of a label of class 2 on hover*/ is a comment)


These CSS style definitions should be placed above

]]></b:skin>


If you are not impressed by the customizability of this blogger label cloud,try this advanced version of the cloud which is highly customizable Label Cloud Widget For Blogger

read more...

Tuesday, 18 August 2009

Related Posts with Thumbnails for Blogger

Related Posts with Thumbnails for Blogger


related posts with thumbnails for blogger

Displaying the links to related posts along with a thumbnail of the corresponding post will help you increase the page views/user .Users will be tempted to go for the related posts when they are presented attractively with thumbnails.




This is another first release from me.This one also uses the media thumbnails generated by blogger for each post.



For displaying the thumbnails,this widget will use the images uploaded for the post using the blogger image uploader(from the post editor) [Update - Now supports external images also.]



Related Posts Widget with Thumbnails for Blogger



Here are the detailed installation steps



1.First of all Login to your blogger dashboard and navigate to Layout > Edit HTML and check the "Expand Widget Templates" check box





2.Now look for




</head>



and replace it with




<!--Related Posts with thumbnails Scripts and Styles Start-->
<!-- remove --><b:if cond='data:blog.pageType == &quot;item&quot;'>
<style type="text/css">
#related-posts {
float:center;
text-transform:none;
height:100%;
min-height:100%;
padding-top:5px;
padding-left:5px;
}

#related-posts h2{
font-size: 1.6em;
font-weight: bold;
color: black;
font-family: Georgia, &#8220;Times New Roman&#8221;, Times, serif;
margin-bottom: 0.75em;
margin-top: 0em;
padding-top: 0em;
}
#related-posts a{
color:black;
}
#related-posts a:hover{
color:black;
}

#related-posts a:hover {
background-color:#d4eaf2;
}
</style>
<script src='http://blogergadgets.googlecode.com/files/relatedthumbs21.js' type='text/javascript'/>
<!-- remove --></b:if>
<!--Related Posts with thumbnails Scripts and Styles End-->
</head>



3.Now Find




<div class='post-footer-line post-footer-line-1'>



If you cant find it then try finding this one




<p class='post-footer-line post-footer-line-1'>


Now immediately after any of these lines(whichever you could find) place this code snippet


<!-- Related Posts with Thumbnails Code Start-->
<!-- remove --><b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='related-posts'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.isLast != &quot;true&quot;'>
</b:if>
<script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?alt=json-in-script&amp;callback=related_results_labels_thumbs&amp;max-results=6&quot;' type='text/javascript'/></b:loop>
<script type='text/javascript'>
var currentposturl=&quot;<data:post.url/>&quot;;
var maxresults=5;
var relatedpoststitle="Related Posts";
removeRelatedDuplicates_thumbs();
printRelatedLabels_thumbs();
</script>
</div><div style='clear:both'/>
<!-- remove --></b:if>
<b:if cond='data:blog.url == data:blog.homepageUrl'><b:if cond='data:post.isFirstPost'>
<a href='http://www.bloggerplugins.org/2009/08/related-posts-thumbnails-blogger-widget.html' style='display:none;'>Related Posts with thumbnails for blogger</a><a href='http://www.bloggerplugins.org/' style='display:none;'>blogger tutorials</a>
</b:if></b:if>
<!-- Related Posts with Thumbnails Code End-->





4.You can adjust the maximum number of related posts being displayed by editing this line in the code.




var maxresults=5;



5.To edit the title of the widget you can change this line of code




var relatedpoststitle="Related Posts";



To change the colors and all you will have to modify the CSS



If you fall into troubles implementing this,don't panic.. :) .just leave me a comment here and i will help you out. If you like to give me any suggestions on how to improve this widget,then it would be really great.



How to display the related posts on every page and not only on the post pages?



Just remove the two lines starting with <!-- remove --> from both step 3 and step 2.



that is lines



<!-- remove --><b:if cond='data:blog.pageType == &quot;item&quot;'>


and



<!-- remove --></b:if>


Permalink: Related Posts with Thumbnails for Blogger

read more...

Wednesday, 12 August 2009

How to add Retweet Button on Blogger

How to add a retweet button on Blogger ?

Twitter is getting more and more famous and so is retweet  Most of you might be knowing of both of this.Still i will give a brief into on both :P

Twitter – Twitter is  a free social networking site that enables users to send short notices of 140 characters. :P

Retweet – This one enables to repost some interesting tweets on twitter.The retweet button can act more like a tweet counter

Adding a retweet button will show a neat count of how many times,your post has been tweeted about,and will also allow your readers to retweet it



Retweet Button Style 1

Code for retweet button style 1 
<div style="float:right;padding:4px;">
<script type="text/javascript">
tweetmeme_url = '<data:post.url/>';
tweetmeme_source = 'your_twitter_user_name';
</script>
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>
</div>



Retweet Button Style 2





retweet-button-for-blogger-style-2


Code for retweet button style 2 

<div style="float:left;padding:4px;">
<script type="text/javascript">
tweetmeme_url = '<data:post.url/>';
tweetmeme_source = 'your_twitter_user_name';
</script>
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>
</div>



Retweet button Compact Style 1



compact-retweet-button-for-blogger-style-1


Code for compact button style 1


<div style="float:left;padding:4px;">
<script type="text/javascript">
tweetmeme_style = 'compact';
tweetmeme_url = '<data:post.url/>';
tweetmeme_source = 'your_twitter_user_name';
</script>
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>
</div>



Retweet Button Compact Style 2





compact-retweet-button-for-blogger-style-2


Code for compact button style 2


<div style="float:right;padding:4px;">
<script type="text/javascript">
tweetmeme_style = 'compact';
tweetmeme_url = '<data:post.url/>';
tweetmeme_source = 'your_twitter_user_name';
</script>
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>
</div>



How to install the Retweet Button on your blog?



1.Select any of these four retweet button styles,and copy the corresponding code into a text file.



2.Now in this code replace your_twitter_username with your actual twitter username



3.Now we have got the final retweet code.Now login to your blogger dashboard and navigate to Layout > Edit Html and expand the widget templates



4.Find this piece of code



<div class='post-header-line-1'/>

and immediately after that place our retweet code(from our text file).and you are done :)

If you were unable to find this code in your template,then look for the first occurance of




<data:post.body/>




and immediately before that, place our retweet code(from our text file)



5.Save the template.



Now you should have a  retweet button near each of your blog posts.





Retweet Button for Blogger classic Templates


This is not for the blogger XML templates that we normally use.If you are using a blogger classic template,these four code styles can't be directly used in your template.You will have to modify any of these four code styles for it to work on the classic template.In any of these four code styles change <data:post.url/> to <$BlogItemPermalinkUrl$>


Now you have got the code for the classic template!


Where to place the code for classic blogger template?


Place the code just above <$BlogItemBody$> and save the template.Now you should have the retweet buttons on your classic blog.



If you liked this post, why not help me by retweeting it.. :)

Additional Note: How to check the retweet count of any url?



To check the retweet count of any url,just go to this url in your browser. http://api.tweetmeme.com/imagebutton.gif?url=http://twitter.com .Make sure to replace http://twitter.com with the url whose retweet count you would like to know.

read more...

Monday, 10 August 2009

Alternate Comment Forms For Blogger

Have you ever felt that the blogger comment form (even the embedded inline one) doesn’t look pretty.Don’t worry you can convert the default comment form of blogger to an stylish commenting system which enables threaded comments and author images.Here i am listing some of the most popular commenting alternatives,.




These are the three famous commenting systems!

 

1. Intense Debate

intensedebate- To give you a better demo,i am using the intense debate commenting system on this post.This is now owned by  Automattic, the makers of Wordpress.This is my personal favorite and i am now confused whether i should switch to this or if i should use the default blogger commenting system.

 

intensedebate-commenting-system






2.DISQUS -

disqus This is another Commenting system – It is the same thing that Mashable.com uses for its comments.

 

disqus-commenting system

3.JS-Kit (Echo)

js-kit  This is also another JavaScript based commenting system.Echo offers both free and paid packages!The free package comes with threaded comments and an interface where the commenter can add videos,images,similes, etc.The commenter can also format his comments using a simple WYSIWYG comment editor.

 

js-kit-commenting system

When you try to go for any of these commenting systems,make sure that you backup your template and keep a copy,so that you can revert back if it didn’t work out well.




These are the three most popular commenting systems.They come with threaded commenting with Gravatar based profile images,which can make you commenting system look more professional.I personally prefer Intense Debate over the others.

So if you want to remove the default blogger commenting system and get a better commenting interface,then you can opt for any of these commenting systems.

Note: These comment forms come with an option to show the comment form on new posts only(means posts with 0 blogger comments)!That means your old comments will stay intact and will use the old blogger comment form.(This is optional.. you can also revert all posts to use the new commenting system.But in that case, you cant display the existing comments easily..)

read more...

Sunday, 9 August 2009

Link to me widget for blogger


This is a nice little widget which can find its place in your blog’s sidebar.You might want to let your readers link back to you in an easy way.We will now make a new Link To Me Widget which will display the code needed for a reader to link back to your blog.We will also provide a Add link using Blogger Button.



This button will work like a widget installer,which makes it easier for your readers to add your link.They can link back to you easily by adding your link to me widget.

How to make the Link to me Widget?

1.First of all Make a Small Logo of your blog,which can easily fit into any blog sidebars.It should be small and pretty :P

2.Now upload this image somewhere.[You can use blogger to upload the logo if you want or you can opt for some service like tinypic.com]

3.Now note the url of this uploaded image

4.Ok now you Copy this Code into a Text File






<p>If you like this blog,then link back to me.<br/>
This is what you will see.</p>
<div style="text-align: center;">
<a style="border:0px;text-decoration:none;" href="Your_Blog_URL" title="Your_Blog_Title">
<img alt="Your_Blog_Title" style="border: 0px;" src="Url_of_a_Small_logo_of_your_blog"/>
</a>
</div>
<textarea rows="3" cols="30">
&lt;a href="Your_Blog_URL" title="Your_Blog_Title" style="text-decoration:none;border:0;"&gt;
&lt;img src="Url_of_a_Small_logo_of_your_blog" alt="Your_Blog_Title" style="border:0" /&gt;
&lt;/a&gt;
</textarea><br/>
<br/>

Optionally use this Widget installer to add this link to your blogger blog.

<form action="http://beta.blogger.com/add-widget" method="post">
<input style="display: none;" value="My Favourite Site" name="widget.title"/>
<textarea style="display: none;" name="widget.content">
&lt;a href="Your_Blog_URL" title="Your_Blog_Title" style="text-decoration:none;border:0;"&gt;
&lt;img src="Url_of_a_Small_logo_of_your_blog" alt="Your_Blog_Title" style="border:0" /&gt;
&lt;/a&gt;
</textarea>
<br/>
<input style="border:0px;" src="http://www.blogger.com/img/add/add2blogger_lg.gif" value="Link To Your_Blog_Title" name="go" type="image"/>
</form>



5.In this code replace all occurrences of Your_Blog_Title with the Title of your blog



6.Replace all occurrences of Your_Blog_URL with the url of your blog.



7.Replace all occurrences of Url_of_a_Small_logo_of_your_blog with the url of the logo that you uploaded.



8.Now your code is Ready!!



9.Copy out the modified code from your text editor.



10.Now Goto Blogger > Layout page



11.Choose to add a gadget and Opt for HTML/Javascript



12.In that widget paste the modified Code and Save.






Now you should have a link to me widget on your blog.If you want to test the Add Link With Blogger Button,Then try adding the widget to your blog itself.[You can remove it after testing!]



With Slight Modifications to the code,you can change this to a text link instead of an image link.



If you need some help in Customizing this widget, then drop in a comment or better contact me via a topic at the Blogger Forum

read more...

Friday, 7 August 2009

Height Fixer For Blogger

Making the Sidebar and the Post Area to be of Same Height

Some of the simple blogger templates use CSS to set the background color of the sidebar and the main post part.In this case,the heights of these two columns can be different making it look a little awkward.In many cases you may want to make both of these columns of the same height.

If you didn't understand what i am talking of,then i will show you some demos.



Check out the sidebars of both


Blog Without Height Fixing – Link

Blog After Height Fixing – Link



The height adjustment can be done using a very simple javascript code.Actually i had to make something like this for another site of mine.So i thought of sharing this with you guys,

Here is the height fixing script.




<!--Height Fixer Starts-->
&lt;script type=&#39;text/javascript&#39;&gt;
&lt;!--
onload=function() {

var mh = document.getElementById(&#39;main-wrapper&#39;).offsetHeight;
var sh = document.getElementById(&#39;sidebar-wrapper&#39;).offsetHeight;
if(sh&gt;mh) mh=sh;
document.getElementById(&#39;main-wrapper&#39;).style.height = document.getElementById(&#39;sidebar-wrapper&#39;).style.height = mh+ &#39;px&#39;
}
//--&gt;
&lt;/script&gt;
<!--Height Fixer Ends-->



What does this height fixer do?



When the page is fully loaded,this javascript code will get executed(as we have used onload). Now the variable mh will get the value of the height of the div with id main-wrapper.The variable sh will get the value of the height of the div with id sidebar-wrapper,Next we make a check.We check if sh is greater than mh.The greater of these values will be assigned to the variable mh






Now we set the height of both the divs[div with id sidebar-wrapper and the div with id main-wrapper]  as sh pixels. So what does this actually do?? This script checks which of these divs have a larger height and assigns that larger height to both of these divs thus making both of them of equal height.



Where to place this height Fixer Code?



The height fixer code can be placed anywhere in the head section of your template.If you are still confused about where to place the code,then place it just above




</head>



Where else Can i Use this Script?



This script can be used anywhere where you need to adjust the height of two divisions(divs) to be the same.In that case don’t forget to change main-wrapper and sidebar-wrapper in this script with the respective ids of those divs.That means you can use this script to adjust the height of any two columns and make them of same height.



Why is the script having so many complex characters like &lt; &gt; etc?.



This is a parsed javascript.Blogger has problems with normal javascript(you might know this if you have tried to add the adsense code into the template).



Does this work on All Browsers?



This is a a very simple javascript code and it will work on all browsers.



Your comments and suggestions are always welcome.

read more...

Sunday, 2 August 2009

Related Posts Widget For Blogger

Related Posts Blogger Widget v1




The related posts widget will show a new related posts section below your post page.The related posts widget fetches the related posts from those posts having the same label as the current post.



To implement the related posts widget you will have to follow 2 simple replacement steps.



1.Login to your blogger account and get into your Dashboard



2.From there goto Template > Edit HTML and expand your widget templates(option on the right)



3.Now find this line of code





</head>



and replace it with







<!--Related Posts Scripts and Styles Start-->
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<style>
#related-posts {
float:center;
text-transform:none;
height:100%;
min-height:100%;
padding-top:5px;
padding-left:5px;
}
#related-posts .widget{
padding-left:6px;
margin-bottom:10px;

}
#related-posts .widget h2, #related-posts h2{
font-size: 1.6em;
font-weight: bold;
color: black;
font-family: Georgia, &#8220;Times New Roman&#8221;, Times, serif;
margin-bottom: 0.75em;
margin-top: 0em;
padding-top: 0em;
}
#related-posts a{
color:blue;
}
#related-posts a:hover{
color:blue;
}
#related-posts ul{
list-style-type:none;
margin:0 0 0px 0;
padding:0px;
text-decoration:bold;
font-size:15px;
text-color:#000000
}
#related-posts ul li{
background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSjzm3oAqIxWPPDdODHBPzlmwJq9ccaKpTk-CJQjlXxNDGA7UTK9owFQJOgvFoeP74LN9bhdnYgttSz5KV1Mfp5ZDXn1Ur-vN77_lhblAPGUMn5lcrV1eteb9QqfWK1CKOZSC2aGdhFIg/s200/greentickbullet.png) no-repeat ;
display:block;
list-style-type:none;
margin-bottom: 13px;
padding-left: 30px;
padding-top:0px;}
</style>

<script type='text/javascript'>
var relatedpoststitle="Related Posts";
</script>
<script src='http://blogergadgets.googlecode.com/files/related.js' type='text/javascript'/>

</b:if>
<!--Related Posts Scripts and Styles End-->
</head>



If you want to change the title of your widget you can edit this line of the above code




var relatedpoststitle="Related Posts";





If you want you can edit the blue and black colors present in this code



4.Now find this line of code




<div class='post-footer-line post-footer-line-1'>



If you cant find it then try finding this one




<p class='post-footer-line post-footer-line-1'>



Now immediately after any of these lines(whichever you could find) place this code snippet




<!-- Related Posts Code Start-->

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='related-posts'>
<b:loop values='data:post.labels' var='label'>

<b:if cond='data:label.isLast != &quot;true&quot;'>
</b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'>

<script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?alt=json-in-script&amp;callback=related_results_labels&amp;max-results=6&quot;' type='text/javascript'/></b:if></b:loop><a href='http://www.bloggerplugins.org/2009/08/related-posts-for-blogger-widget.html' style='display:none'>Related Posts Widget</a>

<script type='text/javascript'>
var currentposturl=&quot;<data:post.url/>&quot;;
var maxresults=5;
removeRelatedDuplicates(); printRelatedLabels();
</script>
</div>

</b:if>
<!-- Related Posts Code End-->




var maxresults=5;



this line determines the number of related posts that are displayed..and by default 6 posts are fetched from each label.



Now you should have a working related posts widget on your blog.If you want to customize the look and feel,then you can alter the CSS rules.OR if you have any doubts or need any modifications,you can surely contact me via comments or at Blogger Forums .The codes are well commented .So this can be easily removed whenever you want..

read more...