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.

Re-using page number for my index pages

August 18, 2012 11:31am

Subscribe [2]
  • #1 / Aug 18, 2012 11:31am

    vodkafish

    122 posts

    Simple question, I think.  I’d like to re-use the page number on any of my index pages.  So any page that’s for categories, or perhaps a blog and has pagination.  Currently, all the page titles and descriptions are the same.  I know it’d be more proper to have Page 2, Page 3, etc. in the title & description and any other appropriate place.

    Right now, all I can think of doing is:

    {exp:channel:entries channel="channel_name" otherattributes…}
        {paginate}
            {current_page}
        {/paginate}
    {/exp:channel:entries}

    Doing that in any spot I need it seems wasteful.  What’s the best method to do this?  An add-on?

  • #2 / Aug 22, 2012 9:41am

    Rob Allen

    3105 posts

    This thread has some ways of doing that - http://ellislab.com/forums/viewthread/215722/

  • #3 / Aug 22, 2012 10:57am

    vodkafish

    122 posts

    Thanks, don’t know why my search didn’t hit that before.  Looks like it’s the same method as I wrote out.  Can {paginate} be called multiple times?  That way I’m not opening and closing {exp:channel:entries} over and over to do the title tag, meta description, etc.  (I’ll test shortly if no one knows off-hand…)

  • #4 / Aug 22, 2012 11:06am

    Rob Allen

    3105 posts

    I helps to know what words/phrases to search for exactly - sometimes it’s a bit hit an miss with any searching.

    Yes you can call a channel entries tag + pagination as many times as you want. Calling the same twice on a page for different purposes is quite common.

  • #5 / Aug 22, 2012 11:09am

    vodkafish

    122 posts

    Sure, I do it always for <head> and <body> bits.  What I meant was something like:

    {exp:channel:entries channel="channel_name" otherattributes…}
        {paginate}
            {current_page}
        {/paginate}
        {paginate}
            {current_page}
        {/paginate}
        {paginate}
            {current_page}
        {/paginate}
    {/exp:channel:entries}

    I’ll go find out…

    * edit, I should add some context to doing that.  Will in a few minutes.

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

ExpressionEngine News!

#eecms, #events, #releases