sharepointsharepoint-2007

Sharepoint Blog Category view - Pagination issue


Folks, I am facing a rather strange issue. In my Sharepoint Blog, I am not able to view more than 10 posts when I click on the Category filter page.

The page only shows the latest 10 posts and when I click on the pagination for the next 10, it simply says that "There are no posts in this category." I tried searching online and some one had a solution to it too, but that is with the Query String (URL) Filter which is not available in MOSS2007 Standard edition...

How can I get around this? Any help would be greatly appreciated...


Solution

  • I found the solution on the net for the Sharepoint Blog Category Pagination issue... and it works for me. Thanks to this blog

    All you need to do is copy paste the following script. Go to the blog/category/Category.aspx and add a Content Editior Web Part. Then go to Source Editor and Copy Paste the following CODE.

    You can also make sure to HIDE the Webpart so that its not visible / annoying to others by ticking Hidden under Layout option.

    <script language ="javascript" type = "text/javascript" > 
    function changeLink(){
    JSRequest.EnsureSetup();
    var Category = JSRequest.QueryString["Name"];
    var parent;
    var child;
    for (var counter =0; counter < 100; counter++){
    var elementId = 'bottomPagingCellWPQ'+ counter;
    if (document.getElementById(elementId)){ 
    parent = document.getElementById(elementId);
    child = parent.childNodes[0].childNodes[0].childNodes[0];
    if (child.childNodes.length > 0){
    for (var y = 0; y < child.childNodes.length; y++ ){
    if(child.childNodes[y].childNodes){ 
    if(child.childNodes[y].childNodes[0].tagName){
    theAnchorTag = child.childNodes[y].childNodes[0];
    for( var x = 0; x < theAnchorTag.attributes.length; x++ ){
    if( theAnchorTag.attributes[x].nodeName.toLowerCase() == 'onclick' ){
    var str = theAnchorTag.attributes[x].nodeValue;
    str = str.replace( '?', '?Name=' + Category + '\\u0026');
    theAnchorTag.attributes[x].nodeValue = str;
    onclk = theAnchorTag.attributes[x].nodeValue;
    theAnchorTag.onclick = new Function(onclk);
    }
    }
    }
    }
    }
    }
    break;
    }
    }
    }
    addLoadEvent(changeLink);
    function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
    window.onload = func;
    } 
    else{
    window.onload = function(){
    if (oldonload) {oldonload();}
    func();}
    }
    }
    </script>