Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-02-16 09:07:17
- nubian
- New Member
- Registered: 2009-02-12
- Posts: 6
Adding class to link generated by txp:link_to_next/prev possible?
example:
<txp:link_to_next class=“nextpage”><span>Next</span></txp:link_to_next>
i’m not sure if this is possible with 4.0.8, but there were no mention of other attributes
available for it in the TXP wiki. Any available plugins that does the same?
This is for using “sprites” for links.
Thanks!
Offline
#2 2009-02-16 17:27:52
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Adding class to link generated by txp:link_to_next/prev possible?
You can do this:
<a class="nextpage" href="<txp:link_to_next />"><span>Next</span></a>
but it gives you an empty href attribute if there is no next article. Possible solution:
<txp:variable name="nextarticle" value='<txp:link_to_next />' />
<txp:if_variable name="nextarticle" value="">
<!-- no next article, show nothing -->
<txp:else />
<a class="nextpage" href="<txp:link_to_next />"><span>Next</span></a>
</txp:if_variable>
Offline