PHPackages                             etc-plugins/etc\_pagination - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. etc-plugins/etc\_pagination

ActiveTextpattern-plugin[Utility &amp; Helpers](/categories/utility)

etc-plugins/etc\_pagination
===========================

Pagination plugin for Textpattern CMS

0.5.0(7y ago)4453[1 issues](https://github.com/etc-plugins/etc_pagination/issues)GPL-2.0PHP

Since Jun 27Pushed 5y ago4 watchersCompare

[ Source](https://github.com/etc-plugins/etc_pagination)[ Packagist](https://packagist.org/packages/etc-plugins/etc_pagination)[ Docs](https://github.com/etc-plugins/etc_pagination)[ RSS](/packages/etc-plugins-etc-pagination/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

etc\_pagination
===============

[](#etc_pagination)

[Download](https://github.com/etc-plugins/etc_pagination/releases) | [Packagist](https://packagist.org/packages/etc-plugins/etc_pagination)

This Textpattern plugin creates a paginated navigation bar on listings. It has a wide variety of attributes – so you are able to customise it until you drop! It can be used alone for `` and `` pagination, but it also has the ability to paginate any list, with a little help from [etc\_query](http://www.iut-fbleau.fr/projet/etc/index.php?id=3).

Please report bugs and problems with this plugin at [the GitHub project’s issues page](https://github.com/etc-plugins/etc_pagination/issues).

Note that this plugin creates a list that is meant to be *styled by you* using CSS.

Installing
----------

[](#installing)

Using [Composer](https://getcomposer.org):

```
$ composer require etc-plugins/etc_pagination:*
```

Or download the latest version of the plugin from [the GitHub project page](https://github.com/etc-plugins/etc_pagination/releases), paste the code into the Textpattern Plugins administration panel, install and enable the plugin. Visit the [forum thread](https://forum.textpattern.io/viewtopic.php?id=39302) for more info or to report on the success or otherwise of the plugin.

Requirements
------------

[](#requirements)

- Textpattern 4.5.0 or newer.

Tags
----

[](#tags)

### etc\_pagination tag

[](#etc_pagination-tag)

```

```

The **etc\_pagination** tag is a *single* or a *container* tag that renders the pagination widget HTML structure.

If used as a container, it must be specified as an opening and closing pair of tags, like this:

```

    ...contained statements...

```

#### Attributes

[](#attributes)

- `atts="value"`
    Additional attributes to apply to the `wraptag` attribute value.
- `break="value"`
    Where value is an HTML element, specified without brackets (e.g., `break="li"`) to separate list items.
- `class="class name"`
    HTML `class` to apply to the `wraptag` attribute value.
- `current="text"`
    A text active on the current tab.
- `delimiter="value"`
    A string to use as delimiter in `general,current` link pairs, see below. Default: `,` (a comma).
- `first="text"`
    Enables you to alter the text inside the ‘first’ link.
- `gap="text"`
    One or two **delimiter**-separated symbols that state that there are more tabs before or after the ones currently viewable. Default: `…`.
- `html_id="id"`
    The HTML `id` attribute assigned to the `wraptag` attribute value.
- `last="text"`
    Enables you to alter the text inside the ‘last’ link.
- `link="text"`
    Enables you to alter the text in the titles of the page tabs. If two **delimiter**-separated strings are given, then the first one will be used on `general` pages, and the second one on the `current` page. Default: `{*}`, where `{*}` will be replaced by appropriate tab numbers, see ‘Replacements’ section below.
- `mask="value"`
    If set, the whole output will be constructed by replacing the patterns `{links}`, `{first}`, `{last}`, `{prev}`, `{next}`, `{}` (gap after) by corresponding strings. Default: unset.
- `next="text"`
    Enables you to alter the text inside the ‘next’ link.
- `offset="number"`
    Page number offset. Default: `0`.
- `page="number"`
    An integer to be considered as `default` page (typically `1`).
- `pages="value"`
    The total number of pages, or a range `start..end`, or a **delimiter**-separated list of `page[::title]` items. Not needed when paginating `` tag (default value).
- `pgcounter="value"`
    The URL parameter to drive the navigation. Not needed when paginating `` tag. Default: `pg`.
- `prev="text"`
    Enables you to alter the text inside the ‘previous’ link.
- `query="a&b=c"`
    A `&`-separated list of GET parameters to be unset/modified in `root`.
- `range="number"`
    The maximum number of left/right neighbours (including gaps) to display. If negative (default), all pages will be displayed. The plugin tries to avoid ‘nonsense’ gaps like `1 … 3 4` and adjust the output so that the number of displayed tabs is `2*range+1`.
- `reversenumberorder="number"`
    Makes it possible to reverse the numbers in the tabs. Setting to value to `0` (default) renders `1,2,3,...`, setting value to `1` reverses the link numbers, `2` reverses theirs hrefs, and `3` reverses both numbers and hrefs.
- `root="URL"`
    The URL to be used as base for navigation, defaults to the current page URL.
- `scale="1"`
    An integer to be used as grid for ‘gap’ links.
- `wraptag="element"`
    HTML element to wrap (markup) block, specified without brackets (e.g., `wraptag="ul"`).

#### Replacements

[](#replacements)

If you are not happy with the default `` links, use `` as container to construct your own links. The following replacement tokens are available inside `etc_pagination`:

- `{$}`
    The absolute page number.
- `{#}`
    The displayed page number.
- `{*}`
    The page title.
- `{current}`
    The text given by `current` attribute, enabled only on the current tab.
- `{href}`
    The page URL.
- `{link}`
    The text given by `link` attribute, replaced by `first`, `prev`, etc when necessary.
- `{pages}`
    The total pages number.
- `{rel}`
    The page relation (`next`, `prev`).

For example, the following (container tag) will generate a `` pagination list:

```

    {link}

```

Fully customised HTML solutions can be achieved – this example outputs, if there are eleven pages and we are on the fifth one, like so:

```

    Prev
    Next

            1

            …

            4

            5

            6

            …

            11

```

### etc\_numpages tag

[](#etc_numpages-tag)

```

```

The **etc\_numpages** tag is a *single* helper tag that counts the number of pages in various lists (articles, images, links, …).

This tag is typically used as a **pages** attribute value, passed to **etc\_pagination**, like this:

```

```

#### Attributes

[](#attributes-1)

Most attributes come from `` and other Textpattern list tags:

- `limit="10"`
    The default value of **pageby**, see below.
- `offset="0"`
    The number of items to exclude from the beginning of the list.
- `pageby="number"`
    The maximum number of items per page.
- `table="txp_table"`
    A name of Textpattern database table from which the list will be extracted. Default: `textpattern` (articles).
- `total="number"`
    An optional list length, if known.
- `author`, `category`, `excerpted`, `exclude`, `expired`, `id`, `include`, `keywords`, `month`, `realname`, `section`, `status`, `time`
    These attributes have the same function as in [txp:article\_custom](http://www.textpattern.net/wiki/index.php?title=article_custom) and other [list tags](http://www.textpattern.net/wiki/index.php?title=Category:List_Tags).

#### Examples

[](#examples-1)

##### Example 1

[](#example-1-1)

```

```

This example shows pagination on individual article pages within the `news` section (i.e., **not** on an article list context page).

### etc\_offset tag

[](#etc_offset-tag)

```

```

Used as helper tag to calculate the offset of article|image|… listing tags. The example above sets the offset to `15` on a page with `...&page=4` URL, so `` will display the fourth page of 5 articles.

#### Attributes

[](#attributes-2)

- `pageby="10"`
    The number of items per page.
- `pgcounter="pg"`
    The URL variable to be considered as page number.
- `offset="0"`
    An optional page offset.
- `type="value|page|start|end"`
    Outputs either the raw (escaped) **value** of `pgcounter`, or the calculated **page** number, or the **start** page item number, or the **end** page item number.

#### Examples

[](#examples-2)

##### Example 1

[](#example-1-2)

```
Showing articles  to
```

Outputs `Showing articles 21 to 30` on the third page of the standard `` list.

Authors/credits
---------------

[](#authorscredits)

Written by [Oleg Loukianov](http://www.iut-fbleau.fr/projet/etc/) and inspired by [ob1\_pagination](http://forum.textpattern.com/viewtopic.php?id=3724). Many thanks to [all additional contributors](https://github.com/etc-plugins/etc_pagination/graphs/contributors).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~222 days

Total

3

Last Release

2799d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/641f63b56b03b23c9d984440ea75e7884ad1e642b2571dc0e6e2ad4ddb388312?d=identicon)[philwareham](/maintainers/philwareham)

---

Top Contributors

[![philwareham](https://avatars.githubusercontent.com/u/413665?v=4)](https://github.com/philwareham "philwareham (34 commits)")[![bloatware](https://avatars.githubusercontent.com/u/11578435?v=4)](https://github.com/bloatware "bloatware (17 commits)")

---

Tags

paginatepaginationpaginatortextpatterntextpattern-pluginpluginpaginatorpaginationpaginatetextpattern

### Embed Badge

![Health badge](/badges/etc-plugins-etc-pagination/health.svg)

```
[![Health](https://phpackages.com/badges/etc-plugins-etc-pagination/health.svg)](https://phpackages.com/packages/etc-plugins-etc-pagination)
```

###  Alternatives

[coffeecode/paginator

Paginator is simple and is ready to generate results navigation in your application

59658.1k1](/packages/coffeecode-paginator)[beberlei/porpaginas

Library that generically solves several pagination issues with DAO/repository abstractions.

163612.6k11](/packages/beberlei-porpaginas)[stefangabos/zebra_pagination

A generic, Twitter Bootstrap compatible, PHP pagination library that automatically generates navigation links

11122.9k](/packages/stefangabos-zebra-pagination)[lampager/lampager-laravel

Rapid pagination for Laravel

7641.4k](/packages/lampager-lampager-laravel)[lampager/lampager

Rapid pagination without using OFFSET

3778.3k5](/packages/lampager-lampager)[ashleydawson/simple-pagination

Simple, lightweight and universal service that implements pagination on collections of things

18161.2k2](/packages/ashleydawson-simple-pagination)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
