Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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_nextandlink_to_previn anarticletag.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)
Offline
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
Re: link_to_next not working
I assume you have a next/prev title otherwise nothing will show with that code..
Offline
Offline
Offline
Offline
Re: link_to_next not working
jstubbs wrote #295010:
So your code is in a page template? Assuming you use an
if_individual_articletag 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)
Offline
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
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
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