Gossamer Forum
Home : Products : Links 2.0 : Customization :

categories alphabetically??

Quote Reply
categories alphabetically??
Hi,...

I know there is a mod to categorize links alphabetically (by single letter A-B-C-etc...).But I have a lot of categories and I want the same for categories by first letter. Is that possible???

Can anybody help me, please?

ThanksCrazy,
Ron
Quote Reply
Re: [sahertianr] categories alphabetically?? In reply to
Hi Ron,

As far as, I understand, please replace the line

foreach $subcat (sort @subcat) {

in the site_html_print_cat in the site_html_templates.pl file

with the below line

foreach $subcat (sort{substr($a,1,1) cmp substr($b,1,1)} @subcat) {

Hope that helps

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] categories alphabetically?? In reply to
no, it doesn't work. Do you have other ideas??

Anyway thanks for your reply!

RonWink
Quote Reply
Re: [sahertianr] categories alphabetically?? In reply to
You want to sort them alphabetically on your homepage?...I though it already did that...hmm
Quote Reply
Re: [Paul] categories alphabetically?? In reply to
Yes. by default the sorting is ok., But I want single letters! Example: the (sub)cats BEARS, BAKERIES , etc. under the category B.

Thanks for your reply! I hope you can help me!

Ron.Blush
Quote Reply
Re: [sahertianr] categories alphabetically?? In reply to
How about just creating top-level categories by letter?....then add all A categories under A, all B's under B etc?
Quote Reply
Re: [sahertianr] categories alphabetically?? In reply to
Hi Ron,

My mistake. the previous line will sort for the second character, not the first one. This shoule work
foreach $subcat (sort{substr($a,0,1) cmp substr($b,0,1)} @subcat) {

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [Paul] categories alphabetically?? In reply to
Yes, Paul, that is an option, but it take a lot of work with 800 (sub)categories.
I must move them all one by one to the correct letter.

Crazy
thanks,
Ron
Quote Reply
Re: [Paul] categories alphabetically?? In reply to
Hi. Paul

Is it possible the use search.cgi as a solution for categories alphabetically. I saw this subject:
RE-Alphasearch by Glennu
*************************
http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=137583;search_string=%24_%20%3D%20%22%5CU%24values%5B%24db_title%5D%5CE%22%3B%20;#137583
*************************
Can something like this be used for showing categories by letter??

Can you help me please??

Thanks Ron.