Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Showing Next and previous article with same category
Just a quick question…
I want to showing Next and previous article with same category. In my research i found this plugin that does the job. jk_neighbour: just like link_to_next/prev
have to try it this week, but thought i ask you lot lot the following:-
1. It’s a couple of years old does it still work in 4.2
2. Is this the best plugin for the job as i need to specify rel and class attributes and i need to get the text link from a custom field.
I think, therefore I AM, … … er … I think :-?
Offline
Re: Showing Next and previous article with same category
Timid&friendly wrote:
does it still work in 4.2
As far as I know, yes it still works. But if it doesn’t you can always try smd_horizon which should do what you want (and a whole lot more).
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
Re: Showing Next and previous article with same category
Thx for the tip. I Tried your plugin because i have had good results with your plugins in the past.
I need a rel attribute in the markup so used own form and now the tag won’t keep to a current category value of “category2”, It just shows all the articles from all categories (parent and sibling cats).
If i try to be clever and parse in the category='txp:category2 />'
it wont link to anything.
<txp:smd_prev category='txp:category2 />' datasort="category2" form="-pag-prev" />
<!-- form="-pag-prev" -->
<a href="<txp:smd_link_to_prev />" rel="prev" class="previous">Previous item: <txp:custom_field name="color" /></a>
What do you think is wrong?
Last edited by Timid&friendly (2010-06-09 17:43:53)
I think, therefore I AM, … … er … I think :-?
Offline
#4 2010-06-09 17:52:58
- Vide-Dressing
- Member
- Registered: 2010-06-07
- Posts: 31
Re: Showing Next and previous article with same category
a “<” is missing in your first line. it should be ‘<txp: and not ‘txp: …
maybe i m wrong … just trying to help
Offline
Re: Showing Next and previous article with same category
Thx Vide. Yeap my bad.
It works now i’ve type it correctly^^. For clarity sake here the code:-
<txp:smd_next category='<txp:category2 />' form="-pag-next" />
<!-- form="-pag-next" -->
<txp:smd_if_end>
<txp:else />
<a href="<txp:link_to_next />" rel="next" class="next">Volgende pen: <txp:custom_field name="Kleur" /></a>
</txp:smd_if_end>
Thx to smd for creating such a fandabbydozzy plugin
I think, therefore I AM, … … er … I think :-?
Offline