Sunday, September 27, 2009

Page Navigation for Blogger (Problems Solved)

Page Navigation for Blogger (Problems Solved)

Bismillah, Alhamdulillah, after some of my json hack for blogger. Now, I’ll try to solve most need hack for blogger is Page Navigation for blogger. Actually this hack I solved 2 months ago, but I’m not make tutorial for that because to explain this hack very difficult.

If we search about Page navigation for blogger will found to the author Mohamed Rias

Tutorial for Page Navigation for blogger by Mohamed Rias :

Page Navigation Hack for Blogger

Page Navigation Menu Widget for Blogger

I think this hack is the best Hack for blogger because useful and use for many blogger, you can see this Blog, all of them use this hack:

bloggerbuster

Bloggertricks

Deluxetemplates

Blogger Pluggin

If we check all comments from many tutorial about this so many question said that it can’t work :

For my Script I used same script from Mohamed Rias (Jazakallahu khoiran ya akhi) but I modified some places.

Now I tried to solve by simple problem first, Page navigation not show, This problem because :

  1. Domain name in first script use only for blogger and Amanda give explanation about this , but in my script no need to change for this problem.
  2. No id name ‘blog-pager’ , to solve this problem you have to change the script base on your ID in blog-pager because some template that not original from blogger they change id name.

Now I’ll explain what is the problem for advanced user. They found these kind of problems :

  1. If we post more than one post in same day, navigation can’t show right result. They solve by only post one post in one day. But it will problem for someone have many post in previous posts and they post more than one in same day, problem because pervious hack only use Date not until Time (Insya Allah this problem Solved in my script).
  2. Label problem, if we click the label it will show more than maximum post per page (problem is from blogger.com) , one blogger have good idea to use max (Blogger Pluggin), but he still use same script, only use max, but if I checked some page not shown properly. If you want know why it can’t solved that problem because Label have different JSON feed (In my script this problem solved insya Allah)

Explanation what I changed inside the script :

  1. Var timestamp , Prev hack only count Date not time, the problem occur when many post in one day.
  2. Separate JSON link and Function script for Page and Label.
  3. Make Max Post for Label.

Follow All tutorial in this post because the script is different from original script. CSS is same with previous hack.

Now tutorial to use my script, I’ll use tutorial from Mohamed Rias

Step 1 : Log in to your blogger account and navigate to Layout section. Now go to the edit HTML subtab.

Step 2 : search this line ]]> and add this CSS code above that line.

It must look like this :

(Picture source from Mohamed Rias)

Step 3 : Now search for this code or related in your template ( no need to expand widgets )



Now Add This script just below the .

if you can’t find you can search (ctrl+f) by this key ” id=’main’ “

Now Add This script just below the .

My Modification Script already solve the problem for Post more than one and Label Problem.

In the code above you can edit this line only :

var pageCount=10;
var displayPageNum=6;

1 : var pageCount = 10;

The Pagecount represents number of posts to be shown in single page. Change the digit to show as many pages you want.

for example :

In my example I have put that value as 10 . In each page you can see only 10 posts .

The number have to same with your setting

The picture show from Setting –> Formatting –> Show –> 10 posts

2 : var displayPageNum = 6;

here the digit 6 represents number of pages to be listed.

For example :

In my example I have chosen 6 , then 6 pages will be shown.

Tutorial from Mohammed Rias only stop here, But for my script have to add modification for label link

Modification Step for Label :

Step 1 : Add Label Gadget (Layout –> page elements –> Add Gadget –> Select Labels)

Step 2 : From Layout –> Edit HTML . Don’t Forget to backup your template (Download Full Template)

Step 3 : Search this

Change to this And Click “save template”

Finished, I hope it can work and This is Demo :

Demo

No comments:

Post a Comment

Popular Posts