Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2020-01-27 16:35:58

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,445
Website GitHub

Re: link_to_next/prev in latest 4.8beta+

etc wrote #321367:

inside link_to_* tags <txp:next_title /> points to the next next title.

If it’s any consolation to Yiannis, I made exactly the same error in the examples within smd_horizon and they remained that way for ages until I actually tried an example recently and spotted it.


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

#14 2020-01-27 16:40:22

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

Re: link_to_next/prev in latest 4.8beta+

I don’t say the tag remained unchanged all this time.

Offline

#15 2020-01-27 17:43:42

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: link_to_next/prev in latest 4.8beta+

Thanks, That works just fine but, should this be changed then?
docs.textpattern.com/tags/next_title… as we seem to not need the next_title tag any longer.

> Edit… again:) Stef’s link includes the tags^^! As such I’m not sure if they are needed as tags or they can just remain as functions… I don’t know.

OK you guys were faster.

Last edited by colak (2020-01-27 18:02:41)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#16 2020-01-27 17:59:06

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,445
Website GitHub

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#17 2020-01-27 17:59:50

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

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

#18 2020-01-27 18:04:48

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

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

#20 2020-02-22 13:21:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,445
Website GitHub

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.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB