Gossamer Forum
Home : Products : DBMan : Customization :

rearranging categories

Quote Reply
rearranging categories
Greetings.

I'm faced with a dilema:
I have a category section (from the category mod) which appears only when the items "exists". It is a musicians' database. As I add musicians, for example, 2 tenors and 1 alto, the category menu on the left show categories for tenors + altos. If I don't have baritones yet, it just doesn't show.

The problem is that by doing this, it shows them in alphabetical order. It needs to be, however, under a very specific order (such as altos, tenors and THEN baritones).

So, the question is this: how can I dictate the categories without having to hard-code them?

Here's a glimpse of the site in progress:

http://www.funkhouserartists.com/html/artists.htm

Thanks again!!!

Quote Reply
Re: rearranging categories In reply to
A "quick & dirty" way would be to create another field called 'sort' and stick a number or letter in it and then sort by that field. Do a search on "sort" or "sort order" (be sure to 'include all posts' as part of your criteria) and you'll find the syntax for including sort order as part of the url like you have in your page ("...id=blah&so=something&ww=on"). <--- I'm guessing at the "so=" part, but you get the general idea.

Ps: nice website

Quote Reply
Re: rearranging categories In reply to
HI, and thanks for your help :)

I'm a bit confused, though...if I create a "sort" field, how will my data (in this case artists) be categorized according to this "sort"? Would I have to add a drop down menu with a number or a letter for when the record is added?

Thanks, once again ;)

L.

Quote Reply
Re: rearranging categories In reply to
Humm...I think I know of an even easier way.

The categories are listed in the right order in my config. file...is there any way to override the alphabetical sorting of the category mod?

Thanks again ;)

Quote Reply
Re: rearranging categories In reply to
I did it in Links, but I'll be darned if I remember how. I'm not familiar with the category mod, but in Links
under "sub site_html_print_cat"

I replaced:
foreach $subcat (sort @subcat) {

With:
sub byfield { $category{$a}[$cat_sort_field] cmp $category{$b}[$cat_sort_field] };
foreach $subcat (sort byfield @subcat) {

And then in the cfg under build options file I added:
$cat_sort_field = 8; #whatever field number you want to sort by

I'm sure there are more things that I changed, but perhaps this could point you in the right direction or help you search for the right thing.

Sorry I couldn't be of more help...

- Mike
No bounce. No play.

Quote Reply
Re: rearranging categories In reply to
If you don't want it to sort then don't use sort.
foreach $subcat (@subcat)

Bob
http://totallyfreeads.com

Quote Reply
Re: rearranging categories In reply to
Dear Bob:

Please don't take it the wrong way, but if was a woman, I would want to have your children.

THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU

L.