About Me

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

Thursday, 10 May 2012

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://bloggergadgets.googlecode.com/files/blogger_pagenavi_min.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.

Tuesday, 24 April 2012

How to Change Default Blogger Anonymous Avatar Comments

Changing default Blogger anonymous avatar on threaded comments. After Blogger announced new feature of threaded comment, we still can costumize avatar for whose comment with 'anonymous' or 'Name/URL'. At first time Blogger using blank image http://img1.blogblog.com/img/blank.gif, so we can hack the template with background for avatar.

Now Blogger using avatar with URL http://img1.blogblog.com/img/anon36.png, and we can't hack this image with background. But we should use jQuery script to hack this. And Let's we go... :)


change default blogger anonymous avatar

To change default Blogger anonymous avatar, follow simple steps below:

1. Go to Template -> Edit HTML
2. Find </body>
3. Add this code just before </body>
<script src='http://code.jquery.com/jquery-latest.js'/>
<script>
$("img[src='http://img1.blogblog.com/img/anon36.png']")
.attr('src', 'your-avatar-url-here')
.ssyby('blank')
</script>
4. Save

Replace the red text with your avatar URL. Or you can select below URLs to replace the link.

1. Blogger
avatar
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsJcBhBJd3sQDu5zdHDNyfTnIWcua4rgTwmbMkMQPZ8NPHlgXNc-1JeV37dHjSYgcUzLOAhiKnBnOwcqywBWvlgr9WvNVVaZs1CdYalet7ZyFGmnv1VmnhMjnwDGQMOQAoFuzfwsT69qw/s1600/blogger2.jpg

2. Anon6
avatar
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirfQgH53zUESRdDBKsmIk9xhdMj52qBHFYZg8Z7beUhI-ZVnIHFzxrRJWCfIsE98rrL72Xvd55bojk9LYClv5bdensxpHKJ5y-m3vfTeDInrgEIF7cHg0d8pVlkion_wjhKxIE8Bv2VsI/s1600/anon6.png

3. Anon7
avatar
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQxtkk2EEZFjguzd81b4l4yrN3XNmQrDxS9jK9-HNmG79NbrY0j5ryhkylDqoe8EBjSVJD8koqC6_FNAFy501_vOlBYs1JElGywvD25zwSpkiNtqhPxNeWB0bdXnG8McJ8oOcJMdwlb6w/s1600/