Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#231 2020-01-29 17:32:01

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,452
Website

Re: etc_pagination: paginate everything

etc wrote #321422:

Yiannis, 169x10 = 1690 > 1689, why ?pg=170 would be listed with 1689 posts?

Maths. I used to be very good at uni but calculators and age has fussed things up. The question now may be irrelevant as it is probably a 4.7.x bug.

<txp:article limit="10" c10="" listform="live_form" form="" /> should list 1686 articles, but the last two are still listed inspite of the CF having a value. Although this behaviour is not replicated in 4.8.b2 where I’ll add some posts in the dev to check it further.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#232 Today 06:11:03

msome
Member
Registered: 2015-09-16
Posts: 27

Re: etc_pagination: paginate everything

Hi.

Pagination:

<div class="pagination">
<txp:etc_pagination prev=">" next="<" wraptag="ul" break="li" reversenumberorder="1" range="4" />
</div>

Tell me, my pagination is displayed only if you add it after <txp:article limit=“14” />

<txp:article limit="14" />
<txp:output_form form="pagination" />

But I need to display the pagination (article), in another block, one level up. But, for me it does not work / is not displayed.

<txp:output_form form="pagination" />
...
...
...
<txp:article limit="14" />

Last edited by msome (Today 06:21:38)

Offline

#233 Today 06:38:44

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,230
Website

Re: etc_pagination: paginate everything

You could add the article count(er) in the <head /> of the page. Something like:

<txp:article pgonly limit="14" />

Using the pgonly attribute only counts the articles, does not display anything. The limit value must match the number of articles you actually want to output per page, I think.


Where is that emoji for a solar powered submarine when you need it ?

Offline

#234 Today 07:18:39

msome
Member
Registered: 2015-09-16
Posts: 27

Re: etc_pagination: paginate everything

Thanks, added code (<txp:article pgonly limit=“14” />) in head,

The pagination was displayed, but

Old articles disappear.
Number of articles per page – 14
Number of pages (pagination) – 14
14 * 14 = 196 articles

Articles older than 197, 198, 199 … – disappear.

____________________________
Why / how to display pagination elsewhere?
After all, everything works directly under the articles.

<div class="pagination">
<txp:etc_pagination prev=">" next="<" wraptag="ul" break="li" reversenumberorder="1" range="4" />
</div>

Last edited by msome (Today 07:24:09)

Offline

#235 Today 07:37:19

etc
Developer
Registered: 2010-11-11
Posts: 4,056
Website

Re: etc_pagination: paginate everything

msome wrote #328210:

Old articles disappear.

That’s weird. What is your txp version?

Why / how to display pagination elsewhere?

Because pagination data is set by <txp:article />, so it needs to be processed first (unless you manually pass the number of pages to <txp:etc_pagination />). You can try the following:

<txp:variable name="articles">
    <txp:article limit="14" />
</txp:variable>
<txp:output_form form="pagination" />
...
...
...
<txp:variable name="articles" />

Other solutions require txp 4.8.4+.

Offline

#236 Today 08:00:27

msome
Member
Registered: 2015-09-16
Posts: 27

Re: etc_pagination: paginate everything

thx etc, txp 4.8.4
Somehow it didn’t work for me.
If you could take a look.

Last edited by msome (Today 10:34:42)

Offline

#237 Today 08:12:24

etc
Developer
Registered: 2010-11-11
Posts: 4,056
Website

Re: etc_pagination: paginate everything

Yes, please, that’s intriguing.

Offline

#238 Today 08:46:41

etc
Developer
Registered: 2010-11-11
Posts: 4,056
Website

Re: etc_pagination: paginate everything

The limit="14" used for pgonly was different from the main <txp:article limit="10" />. Anyway, you don’t need it any more, everything looks fine (127 articles = 13 pages)?

I have replaced <txp:article limit="10" /> with <txp:article[1] limit="10" />. It forces this tag to be processed before its siblings.

Offline

#239 Today 08:58:33

msome
Member
Registered: 2015-09-16
Posts: 27

Re: etc_pagination: paginate everything

works thanks etc

127 article

if <txp:article[1] limit="12" /> --- 11 pages
if <txp:article[1] limit="10" /> --- 13 pages
article[1] ?

Where can I read, about ( article1 )?

Last edited by msome (Today 09:12:55)

Offline

#240 Today 09:42:27

etc
Developer
Registered: 2010-11-11
Posts: 4,056
Website

Re: etc_pagination: paginate everything

msome wrote #328216:

Where can I read, about ( article[1] )?

It’s briefly mentioned in 4.8.4 history, but not documented yet. This syntax allows to alter the processing order. In

<txp:output_form form="pagination" />
<txp:article limit="14" />

tags are processed downwards: output_form first, then article. But since we need article to be processed before pagination, we can indicate to the parser in which order it should proceed:

<txp:output_form form="pagination" />
<txp:article[1] limit="14" /> <!-- [1] means process it first -->

Offline

Board footer

Powered by FluxBB