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
['https://expressionengine.stackexchange.com/questions/602', 'https://expressionengine.stackexchange.com', 'https://expressionengine.stackexchange.com/users/281/']
I wrote a [plugin](https://github.com/tyssen/Page-Number.ee_addon) 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.

Parameters:

**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
With Stash, inside you pagination tag pair you could do:

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

```

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

Another potential is to use [Mo' Variables](http://devot-ee.com/add-ons/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.