Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-02-14 02:28:15

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Showing different category listings for Category 1 vs Category 2 menu

Hi,

I have two major parent categories A and B and was wondering whether there is a way to list only the children of A under the Category 1 drop menu and respectively the children of B under the Category 2 menu in the Write tab?

The reason is, I’ve noticed users getting confused when they see identical listings in both dropdown menus when I’d rather want them to see this:

Category 1:

A
  • 1
  • 2
  • 3

Category 2:

B
  • 4
  • 5
  • 6

I wouldn’t be afraid to modify the txp core, if this was at all possible.

Martin

Last edited by masa (2008-02-14 02:37:00)

Offline

#2 2008-02-16 01:29:23

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Showing different category listings for Category 1 vs Category 2 menu

No response, so I assume the answer is no (?!)

Offline

#3 2008-02-16 12:23:52

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Showing different category listings for Category 1 vs Category 2 menu

The answer is almost always yes. If not by using a TXP core function, then by using an existing plugin (check textpattern.org, quite a few category plugins there) or by writing your own plugin.

Offline

#4 2008-02-16 13:31:50

amordecosmos
Plugin Author
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 114
Website

Re: Showing different category listings for Category 1 vs Category 2 menu

I think the question Masa is asking is not can category 1 and category 2 lists be separate when displayed on a site but can they be separate on the admin side.

This is something that I would love to be able to do as well:

When entering an article on a site of mine, category 1 is used to determine: Blog or Sidebar or Feature Article;
category 2 is used to note whether it is an Online Original, Reprint from the paper version, Video, or Podcast. (Section is used for Film, Music, Theatre, etc.)

The problem for contributors is when they click “Category 1”, they see the entire list Blog, Original, Feature, Podcast, Reprint, Sidebar, Video. Then when they click “Category 2” they see: Blog, Original, Feature, Podcast, Reprint, Sidebar, Video.

What I would like (and what I think Masa is asking) is to restrict category1 to category1 dropdown (Blog, Sidebar, Feature) and category2 to category2 dropdown (Original, Podcast, Reprint, Video).

I have yet to see a plugin that does it (yet.)

Anyone have ideas?

Offline

#5 2008-02-16 13:56:36

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Showing different category listings for Category 1 vs Category 2 menu

If you don’t mind changing TXP core code, edit /textpattern/include/txp_article, change line 837 (in the category_popup function) from:

$rs = getTree('root', 'article');

into:

$rs = getTree($id, 'article');

If you then create two parent categories, named: ‘category-1’ and ‘category-2’, each having child categories, you’ll get what you want.

It’s possible to do this in a plugin as well by using javascript to replace both select fields.

Last edited by ruud (2008-02-16 14:00:27)

Offline

#6 2008-02-16 14:06:40

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Showing different category listings for Category 1 vs Category 2 menu

amordecosmos wrote:

What I would like (and what I think Masa is asking) is to restrict category1 to category1 dropdown (Blog, Sidebar, Feature) and category2 to category2 dropdown (Original, Podcast, Reprint, Video).

Thanks amordecosmos for clarifying my explanation!

Yes, that’s exactly what I had in mind!

And thanks Ruud, I’ll try this tonight – looks easy enough.

Offline

#7 2008-02-16 16:25:23

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Showing different category listings for Category 1 vs Category 2 menu

Ruud, thank you soooo much!

This works extremely well, even with grandchildren categories. The only catch was, I needed to rename my existing parent categories to ‘category-1’ and ‘category-2’ for the drop-down menu to show up.

Thanks again, this will make an enormous difference for the enduser!

Cheers Martin

Offline

#8 2008-02-17 18:16:46

amordecosmos
Plugin Author
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 114
Website

Re: Showing different category listings for Category 1 vs Category 2 menu

I just did it. It is amazing!

Can we have this in core? This is the way I always thought it should have worked!

(And thanks.)

Offline

#9 2008-02-17 18:41:15

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: Showing different category listings for Category 1 vs Category 2 menu

amordecosmos wrote:

I just did it. It is amazing!

Can we have this in core? This is the way I always thought it should have worked!

(And thanks.)

that wouldn’t make any sense to be in core. that means you’d only be allowed to have 2 parent categories and they’d have to be named category-1 and category-2.

Last edited by iblastoff (2008-02-17 18:41:44)

Offline

#10 2008-02-17 19:23:29

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Showing different category listings for Category 1 vs Category 2 menu

iblastoff wrote:

that wouldn’t make any sense to be in core. that means you’d only be allowed to have 2 parent categories and they’d have to be named category-1 and category-2.

I agree it’s not ideal.
However your category title can be anything you prefer and since these two parent categories would only be used to separate child categories to show up under the Category 1 or Category 2 drop menus, but not to actually tag any articles with, I don’t think this would be a big issue.

Perhaps what really should be incorporated in the core is a single category listing allowing for multiple selections.

I know we have rss_unlimited_categories, but that leaves the existing Category 1 and Category 2 drop menus visible and hence only adds to the users’ confusion.

Last edited by masa (2008-02-17 19:25:15)

Offline

#11 2008-02-18 00:03:50

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Showing different category listings for Category 1 vs Category 2 menu

masa, I think ied_hide_in_admin lets you hide categories.

Offline

#12 2008-02-18 01:33:57

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: Showing different category listings for Category 1 vs Category 2 menu

yah what jm said. whenever i use rss_unlimited_categories, i just throw on ied_hide_in_admin and voila (actually i use ied_hide_in_admin all of the time). its just a shame the write page isn’t more customizable without some ‘cheap’ javascript hiding.

Offline

Board footer

Powered by FluxBB