Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#229 2020-01-29 11:59:21

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: etc_pagination: paginate everything

I discovered a minor issue which exists on 4.7.x but I have to check further for the latest betas. I am not sure if this issue is with the etc_pagination or txp.

The plugin does not seem to be listing pages which do not reach the 10 limit. The bug is demonstrated in our site after visiting the last page, and clicking on the last article. In theory, the previous links (appearing on the left), should have been visible on ?pg=170 (or rather not… see below) which is not listed.

The tags I use:

<txp:article limit="10" c10="" listform="live_form" form="" />
<txp:etc_pagination range="5" prev="Previous" next="Next"  wraptag="ul" break="li" />

A note here that on 4.7.x the remaining links have no value in the c10 cf and in my understanding, they should not be appearing there.

On the latest beta, those links are correctly omitted.

I have to create some faux articles in order to further observe the behaviour in 4.8 beta.

For your info, the particular section has 1689 posts, three of which are marked with the cf field and they appear in the home page of the blog.

The complete structure of the page is available on github.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#230 2020-01-29 16:51:19

etc
Developer
Registered: 2010-11-11
Posts: 5,211
Website GitHub

Re: etc_pagination: paginate everything

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

Offline

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#232 2021-01-18 06:11:03

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

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 (2021-01-18 06:21:38)

Offline

#233 2021-01-18 06:38:44

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,210
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 ?
Sand space – admin theme for Textpattern

Offline

#234 2021-01-18 07:18:39

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

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 (2021-01-18 07:24:09)

Offline

#235 2021-01-18 07:37:19

etc
Developer
Registered: 2010-11-11
Posts: 5,211
Website GitHub

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 2021-01-18 08:00:27

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

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 (2021-01-18 10:34:42)

Offline

#237 2021-01-18 08:12:24

etc
Developer
Registered: 2010-11-11
Posts: 5,211
Website GitHub

Re: etc_pagination: paginate everything

Yes, please, that’s intriguing.

Offline

#238 2021-01-18 08:46:41

etc
Developer
Registered: 2010-11-11
Posts: 5,211
Website GitHub

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 2021-01-18 08:58:33

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

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 (2021-01-18 09:12:55)

Offline

#240 2021-01-18 09:42:27

etc
Developer
Registered: 2010-11-11
Posts: 5,211
Website GitHub

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