Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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 Today 02:41:37

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,233
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

#31 Today 08:37:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,317
Website GitHub

Re: link_to_next not working

The behaviour of link_to_* changed a while ago. It now automatically changes context inside the container tag to “previous” or “next” article on your behalf. So you no longer need to use prev_title or next_title tags. In fact, as you found, doing so will fetch the title of the article one beyond the article you expect.

Short answer: swap your prev_title and next_title tags for just <txp:title /> and it’ll work.


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

#32 Today 09:35:06

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

Re: link_to_next not working

Bloke wrote #342039:

Short answer: swap your prev_title and next_title tags for just <txp:title /> and it’ll work.

Does this mean that prev_title and next_title tags are deprecated? If so, we should mark them as such in the Tag reference index.


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

Offline

#33 Today 11:59:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,317
Website GitHub

Re: link_to_next not working

colak wrote #342040:

Does this mean that prev_title and next_title tags are deprecated?

No. There are situations where you want to show the previous or next title but not link to them (e.g. to tease future articles). So these tags are useful outside of link_to_* context.


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