Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-10-28 08:38:29

alesh
Member
From: Miami, FL
Registered: 2005-04-13
Posts: 228
Website

Multiple category url?

This is one of those “still a txp noob after 10 years” things. I need to have have a section with articles representing programs for children, teens, adults, and teachers. I need links for each of those 4 article lists. Two catches. (1) Some articles have up to THREE of those categories. (2) I want pretty category names displayed with each article e.g. “Education program for children, teens, and adults” or “education/children/teens/adults” whatever.

I’m trying to decide between two approaches: (a) a plugin to allow me to add more than two categories per article, plus a tangle of conditionals to control display of the category names I want, or more likely (b) a category for each possible combination of categories (In reality I would only need 8) with the names formatted correctly, but then I’d need to hardcode 4 separate sections and article_custom each one to custom pull from the appropriate combination of categories.

The second approach is the way to go, right? Or is there some other idea? (And BTW, is it possible to url int two separate categories? e.g. “/section/?c=child&c=teen”?)


Yes, I have tried turning it off and on.

Offline

#2 2016-10-28 09:38:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

Re: Multiple category url?

Have you considered tags instead? smd_tags, for example, while not currently very pretty under 4.6.0 because I need to rebadge the UI, should still work if you grab the current dev version from my GitHub account. If you’re on 4.5.x then get the latest version from my site.

You could then tag articles with teen, adult, teacher, etc and use the plugin’s filtering system to display lists of articles that match given tags. And, yes, with that plugin you can combine tags to filter AND/OR if you’re cunning.

If you do decide to give it a go, please report anything that doesn’t work and I’ll do my best to bring it up to scratch. Bear in mind that the GitHub version isn’t a compiled plugin so you’ll either have to drop the .php file in your Plugin Cache Directory (see your Prefs) or install it via ied_plugin_composer.


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

#3 2016-10-28 18:34:13

alesh
Member
From: Miami, FL
Registered: 2005-04-13
Posts: 228
Website

Re: Multiple category url?

Looks like a cool plugin, but that is a bit of a heavy solution for what I’m doing (just a few articles, just a few category combinations, plus I need it to be kinda user-friendly so the category drop-downs are more appealing).

I went with the multiple categories, and sections that each pull from the right combination. Feels hacky, but it works, and now that it’s set up the ugliness is hidden from the user.

Side benefit: cleaner URL’s.


Yes, I have tried turning it off and on.

Offline

Board footer

Powered by FluxBB