Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
No pagination with article_custom
I create an article list for a particular year.
<txp:article_custom section="articles" month='2025'
class="article-list"
form="article_listing"
limit="10"
wraptag='ul' />
The first 10 matching articles are rendered, but not the older/newer links created by the following code.
<txp:evaluate test="older,newer">
<nav class="page-item paginator" aria-label="<txp:text item="page_nav" />">
<txp:older rel="next">
« <txp:text item="older" />
</txp:older>
<txp:output_form form="home_button" />
<txp:newer rel="prev">
<txp:text item="newer" /> »
</txp:newer>
</nav>
</txp:evaluate>
Further on, two errors are thrown.
Tag error: **<txp:older rel="next">
« <txp:text item="older" />
</txp:older>** -> ** Textpattern Warning: secondpass < 2 while parsing form **None** on page **archive****
Tag error: **<txp:newer rel="prev">
<txp:text item="newer" /> »
</txp:newer>** -> ** Textpattern Warning: secondpass < 2 while parsing form **None** on page **archive****
What’s wrong here? What did I miss?
Offline
Re: No pagination with article_custom
By default, <txp:article_custom /> does not get/set pagination data. There are two options:
- either use
<txp:article ... />instead (preferred, but limited in txp 4.8) - or add
pagebyandoffsetattributes:
<txp:article_custom pageby offset ... />
Hope that helps.
Offline
Re: No pagination with article_custom
etc wrote #341105:
By default,
<txp:article_custom />does not get/set pagination data. There are two options:
- either use
<txp:article ... />instead (preferred, but limited in txp 4.8)- or add
pagebyandoffsetattributes:
<txp:article_custom pageby offset ... />...Hope that helps.
p.
Yes, it does, at least partially. The errors are gone now. Thanks so far.
Offline
Re: No pagination with article_custom
The remaining problem is that, the search term in the URL is missing in all suceeding pages.
Initial:
http://txp.local/index.php?s=articles&d=2022
Succeeding: (after clicking on “older”)
http://txp.local/index.php?s=articles&pg=2
By the missing &d=2022 the default txp:article will be called instead of txp:article_custom, leading to an unwanted result.
I have currently no idea how to solve this. What is the Textpattern way for such problems?
Offline
Re: No pagination with article_custom
You an try to wrap the older/newer block in
<txp:page_url context="s,d">
...
</txp:page_url>
Add to context other pertinent URL parameters if needed.
Offline
Pages: 1