2012-06-21 18:07:46

rossharvey
Member
êta
Real name: Ross Harvey
From: Norwich, UK
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

 

2012-06-21 18:17:08

Bloke
Developer
omega
Real name: Stef Dawson
From: Leeds, UK
Known languages: Engl(ish)
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

 

2012-06-21 18:19:37

rossharvey
Member
êta
Real name: Ross Harvey
From: Norwich, UK
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

 

2012-06-21 18:32:43

joebaich
Member
lambda
Real name: Joe
From: DC Metro Area and elsewhere
Known languages: En, Sc, Fr, De.
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

 

2012-06-21 18:45:35

rossharvey
Member
êta
Real name: Ross Harvey
From: Norwich, UK
Website

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

Thanks Joe!

Offline

 

2012-06-21 18:50:41

Bloke
Developer
omega
Real name: Stef Dawson
From: Leeds, UK
Known languages: Engl(ish)
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

 

Powered by FluxBB