Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: link_to_next/prev in latest 4.8beta+
The docs need updating in that example, yes. But the <txp:next_title> tag is useful if used outside of a link_to context. Useful if you want to construct stuff manually for whatever reason, or want to tease the name of an upcoming article without linking to it.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: link_to_next/prev in latest 4.8beta+
colak wrote #321370:
Thanks, That works just fine but, should this be changed then? docs.textpattern.com/tags/next_title or do we not need the next_title tag now?
Absolutely! The tag is still useful if you want to construct your own links to next/prev.
Edit: I second Stef!
Offline
Re: link_to_next/prev in latest 4.8beta+
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#19 2020-02-22 13:04:16
- singaz
- Member
- Registered: 2017-03-12
- Posts: 150
Re: link_to_next/prev in latest 4.8beta+
And I stepped on this rake.
In older versions, the code worked correctly
<span class="prev"><txp:link_to_prev><txp:prev_title /></txp:link_to_prev></span>
<span class="next"><txp:link_to_next><txp:next_title /></txp:link_to_next></span>
In version 4.8, need <txp:prev_title />/<txp:next_title /> to change to <txp:title />
The documentation is misleading

Sorry my horror English. I’m learning textpattern, I’m learning English
Offline
Re: link_to_next/prev in latest 4.8beta+
singaz wrote #321851:
In version 4.8, need
<txp:prev_title />/<txp:next_title />to change to<txp:title />The documentation is misleading
As far as I know, the docs have been changed but please let us know if you spot any errors. As far as being misleading, we should make a note about the changed behaviour, yes. It’s more consistent now. Note that:
<a href="<txp:link_to_next />">
<txp:next_title />
</a>
is correct, as is:
<txp:link_to_next>
<txp:title />
</txp:link_to_next>
When used as a container, the tag innards represents “this link” i.e. the next/prev link is already set up for you, so you need to use the current title or other article tags inside it to fetch information about it.
But if you’re building links yourself (as in the first example above) or displaying information about neighbouring articles when not inside a next/prev container, you still need to use the next_title/prev_title variants.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline