Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Incorrect output for txp:newer and txp:older (?)
TBC, but Something Odd is going on I think with <txp:newer />
and <txp:older />
TXP 4.9-dev + PHP 8.3.1
Input (list page template):
<txp:evaluate test>
<link rel="prev" href="<txp:newer />">
</txp:evaluate>
<txp:evaluate test>
<link rel="next" href="<txp:older />">
</txp:evaluate>
actual output:
<link rel="prev" href="<a href="http://txp.local/playground/?pg=2">2</a>">
<link rel="next" href="<a href="http://txp.local/playground/?pg=4">4</a>">
expected output:
<link rel="prev" href="http://txp.local/playground/?pg=2">">
<link rel="next" href="http://txp.local/playground/?pg=4">">
Similar example in use on the blog section of textpattern.com; code here
If I insert this in the <body />
– nearly verbatim the example in the docs,
<p>test: newer <txp:newer /> and older (1) <a href="<txp:older />">foo</a> and(2) <txp:older>foobar</txp:older> and(3) <txp:older />
output is not exactly what I expected:
<p>test: newer <a href="http://txp.local/playground/?pg=2">2</a> and older (1) <a href="<a href="http://txp.local/playground/?pg=4">4</a>">foo</a> and(2) <a href="http://txp.local/playground/?pg=4">foobar</a> and(3) <a href="http://txp.local/playground/?pg=4">4</a>
–^–
This is I think fairly recent, might be this commit [???]
BTW – hard to reproduce on the dev-demo site, as that has only one page for the section
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Incorrect output for txp:newer and txp:older (?)
Yep, it’s a regression. Will fix, thank you.
Offline
Re: Incorrect output for txp:newer and txp:older (?)
… Same behavior with this:
<txp:evaluate test='<txp:images type="caption" />'>No results...</txp:evaluate>
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: Incorrect output for txp:newer and txp:older (?)
Pat64 wrote #336276:
… Same behavior with this:
<txp:evaluate test='<txp:images type="caption" />'>No results...</txp:evaluate>
I may be wrong but my understanding is that testing for the results of an expression needs to use the query
attribute and that test
was for specifying which txp:tag in a container is the relevant one to test against.
Also the type attribute is only for txp:image_info. For the negative result, you also need either the not
attribute, or the txp:else
case.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Incorrect output for txp:newer and txp:older (?)
You are right!
I forgot the needed query
attribute (see here: https://forum.textpattern.com/viewtopic.php?pid=332047#p332047)…
Last edited by Pat64 (2024-01-03 03:00:15)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: Incorrect output for txp:newer and txp:older (?)
etc wrote #336248:
Yep, it’s a regression. Will fix, thank you.
I see you fixed it nicely. That works smoothly now. Thank you.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline