Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-12-29 15:52:29

moshelakin
New Member
Registered: 2021-12-29
Posts: 1

Link to next article based on custom field

Hey guys, I wonder if some one can help.

I am trying to link to the next article based on the custom field entry. I thought some thing like this would work:

<txp:link_to_next YouTubeSeries=“alienisolation” ><txp:next_title /></txp:link_to_next>

I’m using glz_custom_fields to have more customer fields and YouTubeSeries is the name of the field. I basically only want to show the next article that has the same YouTubeSeries entry.

Any help would be greatly appreciated!

Offline

#2 2021-12-29 16:51:04

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

Re: Link to next article based on custom field

Hello, welcome to the forum.

Not sure for glz_cf, but in txp 4.8.8 you can try adding match="YouTubeSeries" to <txp:article /> tag in the individual part of your article form:

<txp:article status match="YouTubeSeries">
    <!-- ...the current article fields... -->
    <txp:link_to_prev>
        <txp:text item="prev" />: <txp:title />
    </txp:link_to_prev>
    <txp:link_to_next>
        <txp:text item="next" />: <txp:title />
    </txp:link_to_next>
</txp:article>

Offline

Board footer

Powered by FluxBB