I want to avoid duplicate titles/descriptions on pages (P1,P2...) so I want to add Page 1, Page 2 in the page title.

Is there a way to know if we are on pagination and which page it is, but outside of pagination tags? Maybe Stash or something like that?

Thank you

2 Answers 2


I wrote a plugin a while back to do this. It was the first one I wrote so apologies in advance if it's not up to scratch.

Example is included in the plugin usage, but basically, place {exp:page_number url_segment="{segment_1}" limit="5"} somewhere in your template.


url_segment: the segment which contains your page number
limit: the same value you have in your channel entries tag which limits the number of entries shown per page

  • could you elaborate on how we could use your plugin to achieve the desired result ? ( some sample code f.ex )
    – janvl
    Nov 28, 2012 at 8:36
  • I knew there was some plugin for this so I will give it a try. thanx
    – Davor Peic
    Nov 28, 2012 at 12:59

With Stash, inside you pagination tag pair you could do:

    {exp:stash:set name="page_number"}
        Page {current_page}
    {!-- any other pagination stuff here --}

Which would give you "Page X" accessible as {exp:stash:get name="page_number"}.

Another potential is to use Mo' Variables, which provides a Pagination Detect Conditional and Page Offset as {if paginated} and {page_offset}, respectively.

So for example

{if paginated}This is a paginated view{/if}

But I just realized {page_offset} isn't going to be quite what you wanted. It will give you some multiple of whatever you have in your limit parameter so will not directly give you "Page 1" "Page 2" etc.

  • Thank you! at the moment I don't use Stash, but if the plugin will not be enough, this will be my next solution.
    – Davor Peic
    Nov 28, 2012 at 13:01
  • I bet the plugin by @Tyssen will be just what you need.
    – Alex Kendrick
    Nov 28, 2012 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.