ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Pages and Pagination - don't work together?

February 20, 2012 3:28am

Subscribe [3]
  • #1 / Feb 20, 2012 3:28am

    jtrascap

    161 posts

    (Found my solution wasn’t complete so I’ve updated this again)

    I use the Pages system to ground some key overview page and rely on the section index to act as the view page, to make the URL cleaner for seo. EG:

    Template            Pages URI     
    
    /blog/overview  ->  /blog
    /blog/index     ->  /blog/article_name

    Since I’m not using the “blog/index”-page for the base pagination, there’s a link problem for page 1.

    Pagination uses it’s own {auto_path}-type setup. You also can’t use another type of path here {auto_path}, {title_permalink}, etc since the braces are parsed decoded in the URL…frustrating.

    A partial solution was in the Entries tag - “paginate_base”. I always forget about this one. It sets the {base_path} for the loop, allowing you to hit the correct target page. So adding:

    paginate_base="/blog/overview"

    to the Entries tag gave me this:

    <div class="recent-articles-list">
    
    {exp:channel:entries
        channel="blog"
        status="Open"
        limit="3"
        dynamic="no"
        paginate="bottom"
        paginate_base="/blog/overview"               
    }

    ..which gives me mostly-working code. I can click forward through the numbers and back again until I hit P1, or the first page, which doesn’t seem to work because the Pages URI points to “/blog” and not “/blog/overview” - the actual physical location. Any of the {pagination_url} links for {first_page} or {previous_page} when it lands on P1 causes a 404. I can hot wire the first link to be a regular link so that works, but it also makes me feel dirty.

    This is as far as I can take it. Is there a way around this?

     

  • #2 / Feb 20, 2012 7:49am

    Boyink!

    5011 posts

    The Pages module was really designed for static, page by page content.  The minute you have more dynamic needs like pagination, categories, archives, etc you’re outside the realm of what it was designed to do.

    I’d recommend ditching it and going down the path described here:
    http://eeinsider.com/articles/simpler-expressionengine-urls-with-a-simple-template/

    The article covers some tools that accomodate paginated URLs.

  • #3 / Feb 21, 2012 12:08pm

    Shane Eckert

    7174 posts

    Hello HilversumJim,

    Mike mentioned that Pages are really for static content and I would agree. The article above is excellent and would be a much better option for dealing with your SEO concerns.

    Is there anything about this approach that brings up concerns for you?

    Can I answer any questions for you?

    Thank you for using the ExpressionEngine forums!

    Cheers,

  • #4 / Feb 21, 2012 2:04pm

    jtrascap

    161 posts

    Thanks guys - sorry for the delay, but birthday celebrations here slow the typing…

    Yeah Mike - I guess I know, but it was juuuuuust about working so I was hoping for a miracle.

  • #5 / Feb 24, 2012 1:06pm

    Shane Eckert

    7174 posts

    Hi HilversumJim,

    I am glad we could help you out!

    If you need anything else, please let me know!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases