Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: etc_pagination: paginate everything
Gocom wrote #289289:
Would be great if the repository was Composer (the package manager, not that web GUI compiler) compatible too.
Carte blanche for any contribution, sir Jukka!
Offline
Re: etc_pagination: paginate everything
etc wrote #289290:
Carte blanche for any contribution, sir Jukka!
Maybe I will, maybe I will (if I don’t get royal lazy). Heck, I wandered here because I’ve already been working with etc_pagination’s code; reworked ancient rah_comments into etc_pagination “module/glue-plugin” last night.
Offline
Re: etc_pagination: paginate everything
Amazing, I will start to comment my code, promise! Probably, etc_pagination needs some kind of qs attribute, to unset/rewrite some parts of its root url.
Edit: now done it in GitHub version, you don’t need to alter $_GET['commented'] anymore. Just call <txp:etc_pagination query="commented" ... /> to remove it from pagination links.
Last edited by etc (2015-03-23 17:51:27)
Offline
Re: etc_pagination: paginate everything
Hi Oleg, what’s the best way to output navigation links based on a <txp:article limit="1" /> tag? Here’s an example:
<txp:if_article_list>
<txp:article limit="1">
<txp:permlink><h3><txp:title /></h3></txp:permlink>
<txp:body />
</txp:article>
<txp:article limit="9" offset="1">
<txp:permlink><h3><txp:title /></h3></txp:permlink>
</txp:article>
<div class="article_nav">
<txp:etc_pagination range="2" prev="Previous" next="Next" wraptag="ul" break="li" />
</div>
</txp:if_article_list>
Basic idea is to display the first article in full, followed by a linked list of the next 9 articles, then paginate.
Unfortunately in the example above the plugin has 46 pagination links instead of 5 (there are 46 articles in this section), so I guess the limit="1" is throwing things off.
Not sure if the second article tag <txp:article limit="9" offset="1"> may throw things off, the offset method does cause some issues with the in-built <txp:older />@ and <txp:newer /> tags, as the next/prev pages will offset by 1 instead of the desired 1+9.
Offline
Re: etc_pagination: paginate everything
Hi Jonathan,
would pageby attribute help?
<txp:article limit="1" pageby="10">
<txp:permlink><h3><txp:title /></h3></txp:permlink>
<txp:body />
</txp:article>
<txp:article limit="9" offset="1" pageby="10">
<txp:permlink><h3><txp:title /></h3></txp:permlink>
</txp:article>
Haven’t tested, but if it works with core tags, it should work with etc_pagination too.
You can also use one default <txp:article />, and output the body with <txp:if_first_article /> tag. Or you need it only on the front page?
Offline
Re: etc_pagination: paginate everything
Hi Oleg, you’re a champ, as always. How could I forget the pageby attribute :(
Yes, this if for the article_list page, so always want the latest article to show the body and then a link to the next 10 articles. The pagination works beautifully now. Thanks!
Offline
#97 2015-09-16 01:06:20
- alivato
- Member

- Registered: 2011-03-31
- Posts: 152
Re: etc_pagination: paginate everything
how to make a pagination
< 15 >
<, > – prev, next
15 – page number
Offline
#98 2015-09-16 10:34:37
- alivato
- Member

- Registered: 2011-03-31
- Posts: 152
Re: etc_pagination: paginate everything
ALSO
Not displayed pagination.
I need pagination in the header < 15 >
So it works.
…
</header>
<section>
<txp:article limit=“2” />
</section>
<txp:etc_pagination prev=”<” next=”>” wraptag=“ul” break=“li” class=“pagi” />
<txp:output_form form=“footer” />
…
And now is not working (
…
<txp:etc_pagination prev=”<” next=”>” wraptag=“ul” break=“li” class=“pagi” />
</header>
<section>
<txp:article limit=“2” />
</section>
<txp:output_form form=“footer” />
…
Offline
Offline
#100 2015-09-16 10:45:04
- alivato
- Member

- Registered: 2011-03-31
- Posts: 152
Re: etc_pagination: paginate everything
It is necessary to put the pagination above tag “article”
<txp:etc_pagination />
…
…
<txp:article />
Last edited by alivato (2015-09-16 10:45:43)
Offline
#101 2015-09-16 10:53:54
Re: etc_pagination: paginate everything
Try this:
<txp:variable name="articles"><txp:article limit="2" /></txp:variable>
<txp:etc_pagination prev=”<” next=”>” wraptag=“ul” break=“li” class=“pagi” />
<txp:variable name="articles" />
Last edited by NicolasGraph (2015-09-16 10:54:14)
Offline
#102 2015-09-16 11:04:25
Re: etc_pagination: paginate everything
alivato wrote #294862:
It is necessary to put the pagination above tag “article”
Yes, it’s a Textpattern limitation. You can circumvent it with pgonly attribute
<txp:article limit="2" pgonly="1" />
<txp:etc_pagination />
<txp:article limit="2" />
or (better) with <txp:variable />, as suggested by Nicolas.
To display only the current page, use range attribute:
<txp:etc_pagination range="0" next="»" prev="«" />
Offline
#103 2015-09-16 11:21:34
- alivato
- Member

- Registered: 2011-03-31
- Posts: 152
Re: etc_pagination: paginate everything
Very good.
Thanks NicolasGraph & etc
Last edited by alivato (2015-09-16 11:22:06)
Offline
#104 2015-09-16 15:31:37
- msome
- Member
- Registered: 2015-09-16
- Posts: 40
Re: etc_pagination: paginate everything
Hi.
How to swap the page numbers.
reversenumberorder=“1” – It does not work
prev 1 2 3 … 10 11 12
to
default page(site.org) – 12 – last articles
12 11 10 … 3 2 1 next
Last edited by msome (2015-09-16 15:54:04)
Offline
#105 2015-09-16 17:26:48
Re: etc_pagination: paginate everything
Hello msome, welcome to the forum.
msome wrote #294907:
reversenumberorder=“1” – It does not work
It works in my tests, but since I have inherited it from ob1_pagination and never really used, I may miss something. What is the result you obtain, and what you’d expect in place?
Offline