Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-07-27 05:24:25

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Tag <txp:older />

From docs:“If there are no articles available having ‘Older’ status (articles ranked lower, or earlier, in the present sort criteria than the article shown at the bottom of the present list) <txp:older /> will not display unless the showalways attribute is set.”

But in my code it displays, what is wrong here?

Page:

<txp:article limit="1" form="uudised" />

form “uudised”:

<txp:if_individual_article>
...
<txp:else />

<txp:article frontpage="0" limit="15" time="any" sort="Posted desc" wraptag="div" break="div" class="tulbad-2">
...
</txp:article>

<div id="navigation">
<p><txp:newer><i class="fas fa-angle-left nav-link"></i> <txp:text item="Uuemad" /></txp:newer>
<txp:older showalways="0"><txp:text item="Vanemad" /> <i class="fas fa-angle-right nav-link"></i></txp:older></p>
</div>

</txp:if_individual_article>

And my website

Last edited by Gallex (2024-07-27 05:46:14)

Offline

#2 2024-07-27 06:53:38

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,734
Website

Re: Tag <txp:older />

I’m guessing it’s the combination of the two txp:article tags that may be confusing the article count. Your page template asks for a single article, but in the form it calls, there’s a second nested txp:article tag for 15 articles per page. What if you change your page tag to be:

<txp:output_form form="uudised" />

or alternatively put your <txp:if_individual_article> … <txp:else /> … </txp:if_individual_article> into your page template.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2024-07-27 08:44:33

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: Tag <txp:older />

jakob wrote #337469:

I’m guessing it’s the combination of the two txp:article tags that may be confusing the article count. Your page template asks for a single article, but in the form it calls, there’s a second nested txp:article tag for 15 articles per page. What if you change your page tag to be:

<txp:output_form form="uudised" />...

in debugging mode txp says:

Tag error:  ->  Textpattern Notice: Page template default does not contain a txp:article tag. while parsing form None on page default
textpattern/publish.php:748 trigger_error()
index.php:74 textpattern()

but it still displays the text

Offline

#4 2024-07-27 14:04:15

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,734
Website

Re: Tag <txp:older />

Your newer/older tags are working now, though. If you’re not re-using the code of your uudised in different places within your site, try including the code from the form directly in your page template instead of using output_form. There will then be a txp:article tag in your page template.


TXP Builders – finely-crafted code, design and txp

Offline

#5 2024-07-27 21:53:01

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

Re: Tag <txp:older />

This warning is more annoying than helping, and is removed in 4.9. Alternatively, you can try playing with pageby attribute.

Offline

Board footer

Powered by FluxBB