Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-14 21:27:57

rmedek
New Member
From: Nashville, TN
Registered: 2005-08-16
Posts: 9
Website

(automatic) specific ordering of categories

Hello,

I’ve seached around and I can’t quite find a method to organize articles by category, and list those categories in a specific order. The site that I’m developing has a menu of services, organized like so:

<blockquote>
Heading

item title, item price
item description

item title, item price
item description

item title, item price
item description

Heading
item title, item price
item description
</blockquote>

Each heading is a category of services, so I figured I’d make those categories in Textpattern and have a separate article entry for each item — have the price as a custom field, the title be the item title, and the body be the item description.

The deal is the client will end up most likely adding or removing categories, and the categories need to be ordered specifically, rather than alphabetically. After trying a few archive-type plugins and getting nowhere I thought of a few alternatives:

  • Hard-code the category listings in the template, but then the client needs to contact me everytime she adds or removes a category.
  • Take a different approach to the menu — have each heading be the title of an article entry, and have all items and information in the body field. But then I rely on the client correctly formatting each entry; tough because she and Textile are not getting along very well.

Has anyone dealt with these issues? Recommend a resource or a plugin that can help point me in the right direction?


All the Dude ever wanted was his rug back.

Offline

#2 2006-06-15 11:26:52

ricetxp
Member
From: London, UK
Registered: 2005-05-24
Posts: 89
Website

Re: (automatic) specific ordering of categories

One approach to get the categories in the order you want is to assign them with a numeric value. For example, you have categories apples, beetroots, carrots which will appear in alphabetical order. To rearrange the order, you can use 01_carrots, 02_apples, 03_beetroots. Remember to use apple, beetroots, carrots in the Article category title so that the numbers won’t show up.

Downside is that it’s a bit clunky, and you’d have to rely on the client getting the numbering right.

Offline

#3 2006-06-15 20:16:27

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,126
Website GitHub

Re: (automatic) specific ordering of categories

If you are going to use numbers, do them with gaps in between, i.e. 5, 10, 15, so that new categories can be inserted in between if needed.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2006-06-15 22:15:58

rmedek
New Member
From: Nashville, TN
Registered: 2005-08-16
Posts: 9
Website

Re: (automatic) specific ordering of categories

Funny, those are both my recent “aha” solution and the reason I ended up not doing it. :) I thought of using numbers but I was afraid that would eventually lock her into an order… especially since deleting a category and reassigning the articles would be a nightmare. Thanks for the ideas, though.

—Rich


All the Dude ever wanted was his rug back.

Offline

Board footer

Powered by FluxBB