Textpattern Forum

You are not logged in. Register | Login | Help

#1 2012-06-21 18:07:46

rossharvey
Member
From: Norwich, UK
Registered: 2005-03-16
Posts: 201
Website

[Core 4.4.1] List - and navigate - through category only

Evenin’ TXP gurus :¬)

Is there a way – preferably using core code – to list articles from a specific category, and limit the next/prev links to that category?

Here’s the context, I’ve been adding all wedding blog posts under the weddings section (obviously!), and I’m now wanting to add a portfolio section to showcase/promote a handful of weddings.

Rather than create a new section – portfolio – and move those selections (I assume this would change the post’s URL to <site>/portfolio/<title> from <site>/wedding/<title>, and break links and google indexing), it would be much easier to simply assign a category named portfolio, and then filter using that on it’s own page.

Can 4.4.1 do this? :¬)

On a side note, if you change the name of a section, is TXP intelligent enough to keep the old blog post URLs, or will it break?

Last edited by rossharvey (2012-06-21 18:17:36)

Offline

#2 2012-06-21 18:17:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,800
Website

Re: [Core 4.4.1] List - and navigate - through category only

Don’t think the core can do it, because article_custom can’t navigate next/prev. But these might help, in this order of potential usefulness:

  1. Roll your own with a few plugins and this tutorial
  2. smd_horizon
  3. aks_article (though I don’t know if it offers pagination)

The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2012-06-21 18:19:37

rossharvey
Member
From: Norwich, UK
Registered: 2005-03-16
Posts: 201
Website

Re: [Core 4.4.1] List - and navigate - through category only

Why is it Stef, that you’ve always made a plugin for something I need? :¬)

Awesomeness!

Edit: I hope you’re on the core team for TXP5.

Last edited by rossharvey (2012-06-21 18:28:41)

Offline

#4 2012-06-21 18:32:43

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 467
Website

Re: [Core 4.4.1] List - and navigate - through category only

Hello Ross,

You can do that with the plug-in txp:jk_neighbour. I don’t recall seeing a core code solution but sometimes I have difficulty remembering my own name. I used the plug-in a couple of years ago in conjunction with txp:chh_if_data:

<txp:chh_if_data> <p>More in the same category &nbsp; &nbsp; <txp:jk_link_to_prev cat="current" sortby="title"> << <txp:prev_title/> </txp:jk_link_to_prev> &nbsp;&nbsp; | &nbsp; &nbsp;<txp:jk_link_to_next cat="current" sortby="title"> <txp:next_title /> >> </txp:jk_link_to_next><p> <txp:else /> <p>[This is the only <txp:category1 /> currently in the collection.]</p> </txp:chh_if_data>

Last edited by joebaich (2012-06-21 18:41:10)

Offline

#5 2012-06-21 18:45:35

rossharvey
Member
From: Norwich, UK
Registered: 2005-03-16
Posts: 201
Website

Re: [Core 4.4.1] List - and navigate - through category only

Thanks Joe!

Offline

#6 2012-06-21 18:50:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,800
Website

Re: [Core 4.4.1] List - and navigate - through category only

Awesome Joe, forgot about that one. I’ll add it to the data bank so it comes at the top of any such lists next time.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB