Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2015-05-22 14:43:48

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: link_to_next not working

You’re still using TXP 4.5.5. Please upgrade to version 4.5.7. Not because of what you asked here, but for other reasons.

Offline

#14 2015-05-22 16:54:13

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: link_to_next not working

laaaars wrote #291005:

Could you please explain in short why article instead of article_custom creates the trouble?

Furthermore, <txp:article /> (documentation) doesn’t work with the id attribute.

Offline

#15 2015-09-20 10:50:54

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: link_to_next not working

Hi,
It’s the kind of day when simple things go wrong…
I use this topic because I can’t make my <txp:link_to_prev /> and/or <txp:link_to_next /> tags work on individual article pages…

Here is the minimal page I’m using to try to understand.

<txp:article break="br" >
<txp:link_to_prev><txp:prev_title /></txp:link_to_prev><br />
<txp:link_to_next><txp:next_title /></txp:link_to_next><br />
</txp:article>

I read old related threads but I can’t understand what’s wrong with these few code lines; it is so simple…

Last edited by NicolasGraph (2015-09-20 11:22:56)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#16 2015-09-20 11:05:40

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: link_to_next not working

Hi Nicolas, how are you using the tags? You shouldn’t need to wrap the link_to_next and link_to_prev in an article tag.

Have you tried the basic version from the docs?

<txp:link_to_next><txp:next_title /></txp:link_to_next>
<txp:link_to_prev><txp:prev_title /></txp:link_to_prev>

Offline

#17 2015-09-20 11:09:48

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: link_to_next not working

jstubbs wrote #295008:

Hi Nicolas, how are you using the tags? You shouldn’t need to wrap the link_to_next and link_to_prev in an article tag.

Have you tried the basic version from the docs?

<txp:link_to_next><txp:next_title /></txp:link_to_next>...

I usually use these tags in my article form, that’s why I nested them in a <txp:article> tag in my page exemple.

Edit: even if I take the@<txp:article>@ tag off, nothing is displayed on individual article pages.

Last edited by NicolasGraph (2015-09-20 11:15:44)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#18 2015-09-20 11:18:41

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: link_to_next not working

So your code is in a page template? Assuming you use an if_individual_article tag you could use something like:

<txp:if_individual_article>
	<txp:article limit="1">
		<h2><txp:title /></h2>
		<txp:body />
		<div class="article_nav">				
			<txp:link_to_next><txp:next_title /></txp:link_to_next><br /><txp:link_to_prev><txp:prev_title /></txp:link_to_prev>	
		</div>
	</txp:article>
</txp:if_individual_article>

Offline

#19 2015-09-20 11:20:14

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: link_to_next not working

I assume you have a next/prev title otherwise nothing will show with that code..

Offline

#20 2015-09-20 11:22:02

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: link_to_next not working

jstubbs wrote #295011:

I assume you have a next/prev title otherwise nothing will show with that code..

Of course.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#21 2015-09-20 11:24:07

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: link_to_next not working

Did you try my code?

Offline

#22 2015-09-20 11:26:07

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: link_to_next not working

jstubbs wrote #295013:

Did you try my code?

Yes, I edited my post


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#23 2015-09-20 11:38:05

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: link_to_next not working

jstubbs wrote #295010:

So your code is in a page template? Assuming you use an if_individual_article tag you could use something like:

<txp:if_individual_article>...

Oh, ok Jonathan, I didn’t see this post, sorry. I gave it a try even before to post on the forum but the limit attribute doesn’t change anything.

Edit: I was working with Mamp. I’m trying to put everything on line to see if the problem persist, I’ll tell you.

Last edited by NicolasGraph (2015-09-20 11:41:23)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#24 2015-09-20 11:40:47

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: link_to_next not working

That’s weird. So must be something else then if there is a next/prev title. Have you checked the sections and so on? Or used a tag trace?

Offline

Board footer

Powered by FluxBB