Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
‘showalways’ for txp:newer (and txp:older) not working?
Usage: <txp:newer showalways>some text</txp:newer> – <txp:older showalways>different text</txp:older>, (preceded by an article list with limit=“10”).
Expected: output the “xxx text” string always even if no newer/older page (list) exists (per docs, unless I am misunderstanding the usage completely).
Actual result: no output when no newer/older page (list) exists. showalways or showalways="1" always show blank.
Textpattern 4.9-dev latest, context is a <txp:pages> block, but standalone usage on a page template returns same results; PHP 8.3 / 8.4.
(I cannot test on TXP 4.8.8 atm).
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: ‘showalways’ for txp:newer (and txp:older) not working?
The construction has changed in 4.9:
<txp:older>
link
<txp:else /><!-- showalways part -->
text
</txp:older>
This is more flexible, but less intuitive, so I will try to combine it with the pre-4.9 functionality.
Offline
Re: ‘showalways’ for txp:newer (and txp:older) not working?
etc wrote #340996:
The construction has changed in 4.9:
<txp:older>...This is more flexible, but less intuitive, so I will try to combine it with the pre-4.9 functionality.
Oh. That does indeed offer some more flexibility, e.g accessibility wise. Now I’ll need to check to update my txp:pages block (which is basically the docs example). So It would probably be nice to if there is a way to get old and new construct.
<txp:newer rel='prev'>
link - previous page
<txp:else />
no previous pages
</txp:newer>
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: ‘showalways’ for txp:newer (and txp:older) not working?
Both constructs should be working now, with an extra flexibility added by showalways:
<txp:newer rel='prev' showalways='...'>
link - previous page
<txp:else />
no previous pages
</txp:newer>
Depending on showalways value (which can be pulled from some variable), it will output the true or the false part when no newer page exists.
Offline
Re: ‘showalways’ for txp:newer (and txp:older) not working?
Sounds great, with lots of flexibility for the first/last item in the pagination.
Thank you 😊.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: ‘showalways’ for txp:newer (and txp:older) not working?
etc wrote #340999:
Both constructs should be working now, with an extra flexibility added by
showalways
Oh that’s so sweet. Thank you.
You know what my next question is going to be regarding showalways in other tags now… 😁
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline