In articles you don't have to do this. You can set the pagination templating in Pagination tab under the Advanced Settings tab.
For the wrapper, I use this (on the template page):
[[[[!+page.nav:notempty=`!$showpagination`]]]]
page.nav is also set on the Pagination page.
In my Chunk I have:
<p>Showing [[+page]] of [[+pageCount]] Pages</p>
<ul class="pagination">
[[!+page.nav]]
</ul>
But your wrapper list (if you using a list) may differ of course, i.e.
<div class="pagination">
[[!+page.nav]]
</div>
And then in the Advanced Settings/Articles tab set things like:
Page Nav Tpl:
<a[[+title]] href="[[+href]]">[[+pageNo]]</a>
And all the other appropriate settings this page lets you set.
[ed. note: rx2 last edited this post 10 years, 3 months ago.]