Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Evans 629 posts 1016 karma points
    Jan 08, 2013 @ 16:53
    Dan Evans
    0

    Archive list on landing page

    On this site the blog landing page shows posts from all months other than the current month which I think is the reverse of what it should do:

    http://gigantic-creative.dedicated.dev.plan9.co.uk/the-work

    Then on post pages all months are expanded not the month of the post:

    http://gigantic-creative.dedicated.dev.plan9.co.uk/the-work/posts/2011/pablo-old-vine-garnacha

    Help!

  • Funka! 398 posts 661 karma points
    Jan 14, 2013 @ 23:36
    Funka!
    0

    Hi Dan,

    Looks like you might be missing the initial rule from the uBlgsy default CSS for the following:

    #uBlogsy_post_archive .uBlogsy_post-items {
     display:none;
    }

    This starts all posts as hidden and then the javascript will show just the month of the post you're looking at. Without this rule, you are seeing all months initially exapnded.

    And, for when you first enter the blog (or anytime not looking at an individual post), there is a bug in the ublogsy javascript where the month you want isn't actually shown, but rather hidden. Here's how we corrected ours, so look for where this gets generated and replace the parts you see I just commented IN CAPS:

    // expand current post item's month (THIS PART WORKS FINE AS LONG AS CSS RULE IS IN PLACE)
    var postItem = $('#uBlogsy_post_archive').find('a[href$="' + window.location.pathname + '"]');
    if (postItem.length == 1) {
        $(postItem).parents('#uBlogsy_post_archive .uBlogsy_post-items').show();
        $(postItem).parents('#uBlogsy_post_archive .uBlogsy_months').show();
    }
    else {
        // FUNKA SAYS: following statement doesn't actually do anything, as 'postItem' in this case is going to be empty
        // expand latest month
        //$(postItem).parents('#uBlogsy_post_archive .uBlogsy_months:eq(0)').show();
        // INSTEAD...
        // trigger click to show first month (FUNKA SAYS: And Year!)
        var $firstmonth = $('.uBlogsy_month_name:eq(0)');
        var $firstyear = $('.uBlogsy_year_name:eq(0)');
        $firstyear.trigger('click');
        $firstmonth.trigger('click');
    }

    Best of luck!

    P.S. site is really nice looking! We work in similar industry across the pond over here.

  • Dan Evans 629 posts 1016 karma points
    Jan 15, 2013 @ 19:03
    Dan Evans
    0

    Thanks for the fix and the compliment! The CSS amend fixed it. I didn't need any JS amends to make it display the correct month on the landing page.

Please Sign in or register to post replies

Write your reply to:

Draft