Gossamer Forum
Quote Reply
YahooSubCats
Summary : Sorting the subcategories by alphabetical order.

Hi, I have just installed the YahooSubCats plug-in, it didn't work at first because I didn't have the code " <%Description%> " in my template. However the installation was so simple it was amazing !

I was wondering however whether there was some way to get the subcategories to be sortered by alphabetical order. At the moment they are sorted by order of creation.

Thanks, Jag

Quote Reply
Re: YahooSubCats In reply to
Hi,
try to go to the Setup->Build
and play with 'build_category_sort' (try to type here: Name)

Quote Reply
Re: YahooSubCats In reply to
You'll need to edit the plugin file YahooSubcats.pm:

Where you see:

my $table = $DB->table('Category');
my $sth=$table->select({'FatherID' => $catid},['Full_Name','Name']);

Add:

$table->select_options('ORDER BY Name DESC');

between those two lines:

my $table = $DB->table('Category');
$table->select_options('ORDER BY Name DESC');
my $sth=$table->select({'FatherID' => $catid},['Full_Name','Name']);


that should do it. (Untested, but it should work.)



PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: YahooSubCats In reply to
Pugdog,
I have just tried it and it does work but puts the categories in inverse alphabetical order so I'll start with category like 'V' and end with a category commencing with an 'A'.

Do you know if there is some way to inverse this ?

Thanks, Jag

Quote Reply
Re: YahooSubCats In reply to
Just a guess, but try ASC instead of DESC

Robert Blackstone
Webmaster of Scato Search
http://www.scato.com
Quote Reply
Re: YahooSubCats In reply to
Good Guess :)

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: YahooSubCats In reply to
Sorry, I'm so used to doing "DESC" for hits counts and ratings... Alpha order is usually "ASC".

PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: YahooSubCats In reply to
How do I remove the space before the subcats begin listing? Currently there appears to be a "Tab" before the subcats are listed, which Yahoo does not do, and I would like to remove as well.

Thanks


Quote Reply
Re: YahooSubCats In reply to
I don't think that's a tab... that's probably an indent (dd or ul) tag in the subcategory.html file around the "description" tag. Remove those and it will format smoothly (also remove the dt/dl tags too).


PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: YahooSubCats In reply to
I tired that ... but it removed all spacing from the table and they are crunched together

Quote Reply
Re: YahooSubCats In reply to
Nevermind finally did simple html and added "margin-top: 0; margin-bottom: 0" and it worked just fine

Quote Reply
Re: YahooSubCats In reply to
sorry... just a question, where did you add that?

Quote Reply
Re: YahooSubCats In reply to
In the subcategory.html

<dl>
<dt><strong><a class="link" href="<%URL%>"><%Short_Name%></a></strong>
<%if Has_New_Links eq 'Yes'%><small><sup class="new">new</sup></small><%endif%>
<%if Has_Changed_Links eq 'Yes'%><small><sup class="new">update</sup></small><%endif%>
</dt>
<%if Description%><small><p style="margin-top: 0; margin-bottom: 0"><span class="descript"><%Description%></p></span></small><%endif%>
</dl>

Quote Reply
Re: YahooSubCats In reply to
Thanks for this very clear instruction. :-)

Quote Reply
Re: [sy1973] YahooSubCats In reply to
And years after that it still works... Wink