Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2011-09-03 19:41:45
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Creating a return to top links after a series of articles
Try this:
<txp:if_different>
<!-- <txp:category2 /> -->
<txp:variable name="cat2_different" value="yes" />
</txp:if_different>
<txp:if_variable name="cat2_different" value="yes">
<txp:if_first_article><txp:else />RETURN TO TOP</txp:if_first_article>
<h2 style="padding-top:5px;"><a name="<txp:category2 />" style="Text-decoration:none;"><txp:category2 /></a></h2>
</txp:if_variable>
<div style="padding-bottom:15px"><h3><txp:title /></h3><txp:if_custom_field name="telephone">Téléphone: 506-<txp:custom_field name="telephone" /><br></txp:if_custom_field><txp:if_custom_field name="cellulaire">Cellulaire: 506-<txp:custom_field name="cellulaire" /><br></txp:if_custom_field><txp:if_custom_field name="fax">Fax: 506-<txp:custom_field name="fax" /><br></txp:if_custom_field><txp:if_custom_field name="email">Courriel: <a href="mailto:<txp:custom_field name="email" />"><txp:custom_field name="email" /></a><br></txp:if_custom_field><txp:if_custom_field name="web">Web: <a href="http://<txp:custom_field name="web" />" target="_blank"><txp:custom_field name="web" /></a></txp:if_custom_field></div>
<txp:if_last_article>RETURN TO TOP</txp:if_last_article>
Offline
#14 2011-09-03 21:54:46
- pafruu
- Member
- From: New Brunswick, Canada
- Registered: 2010-01-14
- Posts: 65
Re: Creating a return to top links after a series of articles
Hello Els,
I tried your suggestion and now each article has a category title and a return to top link.
after a little pondering around, with all of your help, I have managed to make it work.
Els, I still used your code but i slightly modified it and now it works:
<txp:if_different>
<!-- <txp:category2 /> -->
<txp:variable name="cat2_different" value="yes" />
<txp:else />
<txp:variable name="cat2_different" value="no" />
</txp:if_different>
<txp:if_variable name="cat2_different" value="yes">
<txp:if_first_article><txp:else />RETURN TO TOP</txp:if_first_article>
<h2 style="padding-top:5px;"><a name="<txp:category2 />" style="Text-decoration:none;"><txp:category2 /></a></h2><txp:else />
</txp:if_variable>
The bottom part of the code stays the same.
Thank you all for your help! Very appreciated
Last edited by pafruu (2011-09-03 22:10:03)
I try, and I try, and I try…. and sometimes I achieve
Offline
#15 2011-09-03 23:32:45
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Creating a return to top links after a series of articles
Well, it’s getting late here but I don’t quite see the difference apart from two superfluous instances of <txp:else />
, this one in the first block:
<txp:else />
<txp:variable name="cat2_different" value="no" />
and the <txp:else />
after the </h2>
in the second block. It should work if you remove them.
But anyway, I’m glad you got it working :)
Offline