Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

jstubbs
Member
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
Member
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
Member
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
Member
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
Member
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

#25 2015-09-20 11:43:22

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

Re: link_to_next not working

jstubbs wrote #295016:

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?

Yes that’s weird, anything seems to be ok. See my previous posting edit; I hope it’s coming from localhost…

Last edited by NicolasGraph (2015-09-20 11:43:40)


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

Offline

#26 2015-09-20 11:52:57

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

Re: link_to_next not working

Ok, the problem is related to the localhost. Everything is ok online not sure, Thanks Jonathan for your replies, do you think I should post something about this kind of bug? I’m checking again…

Last edited by NicolasGraph (2015-09-20 12:02:29)


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

Offline

#27 2015-09-20 12:01:31

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

Re: link_to_next not working

Mmm I’m not sure. Maybe search first to see if there have been any other issues with MAMP and next/prev.

Offline

#28 2015-09-20 12:19:14

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

Re: link_to_next not working

NicolasGraph wrote #295018:

Ok, the problem is related to the localhost. Everything is ok online not sure, Thanks Jonathan for your replies, do you think I should post something about this kind of bug? I’m checking again…

I spoke to fast but I found a clue online. On individual article pages, there is only the previous link I wrapped in a usual condition and it is linked to the older article on every article page but the older one (on which nothing is displayed). I don’t already know why but it’s a first step…

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


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

Offline

#29 2015-09-20 12:55:20

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

Re: link_to_next not working

Solved!
I thought I was running a minimal page template but I had variables loaded in my Head form and one with a txp:article tag! I changed it to txp:article_custom and everything goes right now!
I know… :-/


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

Offline

#30 2025-12-31 02:41:37

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,252
Website Mastodon

Re: link_to_next not working

I cannot suss out what is going on.

this code

<txp:if_individual_article>
			<hr class="space">
			<p>
 		<txp:link_to_prev> &#171; <txp:prev_title /></txp:link_to_prev> | <txp:link_to_next><txp:next_title /> &#187;</txp:link_to_next>
				</p>
		</txp:if_individual_article>

produces this

<a title="Automatic Thumbnails" rel="prev" href="http://textism.local/work/automatic-thumbnails"> &#171; Casa Ancona</a> | <a title="Palazzo Campbell" rel="next" href="http://textism.local/work/palazzo-campbell">Guggenheim Museum Bilbao &#187;</a>

NOTE the titles and links don’t correspond correctly.

If I leave out the the <txp:prev_title /> and <txp:next_title /> the directional arrows post to the prev and the next sans titles correctly

This code:

<txp:link_to_prev> &#171;  </txp:link_to_prev> | <txp:link_to_next>  &#187;</txp:link_to_next>

produces these correct prev/next links

 	<a title="Automatic Thumbnails" rel="prev" href="http://textism.local/work/automatic-thumbnails"> &#171;  </a> | <a title="Palazzo Campbell" rel="next" href="http://textism.local/work/palazzo-campbell">  &#187;</a>
				</p>

so why this incorrect output of titles? I see no clue in the documentation for why this is happening?


…. texted postive

Offline

Board footer

Powered by FluxBB