Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Categories drop down menu

Quote Reply
Categories drop down menu
Hi

I would like to apply a css style to this drop down menu (the one you can found in the add or modify form) but we can't do it via templates.

Do yo know where we do have to add the style? and wich file to modify?



Txs

FMP
Quote Reply
Re: [fmp] Categories drop down menu In reply to
Well, it's in admin\Links\User\Add.pm. There is a _category_list function.

This creates the list of all categories. You can create a 'category_list' global with similar content:
Code:
sub {
# -------------------------------------------------------------------
# Return a list of all the categories.
#
my $category;
if ($CFG->{db_gen_category_list}) {
my $links_db = $DB->table('Links');
my $html = $DB->html($links_db, $IN);
my @ids = $IN->param('CatLinks.CategoryID') || $IN->param('ID');
$category = $html->get_all_categories(\@ids, 'CatLinks.CategoryID', 1);
}
else {
my $cat_db = $DB->table('Category');
my $id = $IN->param('CatLinks.CategoryID') || $IN->param('ID');
my $sth = $cat_db->select ( { ID => $id }, ['Full_Name'] );
my ($name) = $sth->fetchrow_array();
if ($name) {
$category = "$name <input type=hidden name='CatLinks.CategoryID' value='$id'>";
}
else {
return;
}
}
return $category;
}

You can modify it to include css as you want.
The html select field is generated with GT::SQL::HTML::Display methods, so if you need to go deeper to add your css, you need to replace the "$db->select" type form generation, and generate the select form yourself.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Apr 20, 2003, 6:11 AM
Quote Reply
Re: [fmp] Categories drop down menu In reply to
Hi,

You don't need to modify any source code, you can do it like so (within your html template):

Code:
<style type="text/css">
SELECT {
background: #000000;
}
</style>
Quote Reply
Re: [Paul] Categories drop down menu In reply to
Your suggested solution will affect all downdrop select forms, sitewide.
My suggested solution makes possible to change color just of that one category select form.
If it is good for him, to have the same select css values for all select form sitewide, then yes, your solution is easier to implement.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Apr 20, 2003, 7:18 AM
Quote Reply
Re: [webmaster33] Categories drop down menu In reply to
Quote:
Your suggested solution will affect all downdrop select forms, sitewide.

No, it is template specific. If I put it in add.html then it will only affect the category list in add.html
Quote Reply
Re: [Paul] Categories drop down menu In reply to
Uhm, yes, it's my mistake. Blush
You are right, of course your suggestion affects only the current html file.
All select forms on that html file.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...