Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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)
Offline
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)
Offline
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
Re: link_to_next not working
NicolasGraph wrote #295018:
Ok, the problem is related to the localhost.
Everything is ok onlinenot 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)
Offline
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… :-/
Offline
#30 Today 02:41:37
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> « <txp:prev_title /></txp:link_to_prev> | <txp:link_to_next><txp:next_title /> »</txp:link_to_next>
</p>
</txp:if_individual_article>
produces this
<a title="Automatic Thumbnails" rel="prev" href="http://textism.local/work/automatic-thumbnails"> « Casa Ancona</a> | <a title="Palazzo Campbell" rel="next" href="http://textism.local/work/palazzo-campbell">Guggenheim Museum Bilbao »</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> « </txp:link_to_prev> | <txp:link_to_next> »</txp:link_to_next>
produces these correct prev/next links
<a title="Automatic Thumbnails" rel="prev" href="http://textism.local/work/automatic-thumbnails"> « </a> | <a title="Palazzo Campbell" rel="next" href="http://textism.local/work/palazzo-campbell"> »</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
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
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
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