Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How to change the height from categories in admin menu?

Quote Reply
How to change the height from categories in admin menu?
Hi!



When adding a new link in thru the admin, the categories select form has a heigth of 5, but when having lot's of categories I've to scroll very much and that becomes very annoying. I'd like to change the heigth to another value, but coudn't find a way. I already looked at the properties of the table (Links: Table Editor) but there was no "category" colum.

Can anybody help me?



sun
Quote Reply
Re: [sun112] How to change the height from categories in admin menu? In reply to
Hi-

I have a lot of categories and I've been trying to find this also. I don't think that it's in the templates, and I can't find the file where it does set the height of the selection box for the categories. Does anyone know where this might be?

-Frank
Quote Reply
Re: [FrankM] How to change the height from categories in admin menu? In reply to
In the source code of the page Links: Add Record is <select MULTIPLE SIZE="5" name="CatLinks.CategoryID">

written, which sets the height to 5.

Now I found in the file adodb-lib.inc.php

if ($multiple or is_array($defstr)) {
if ($size==0) $size=5;
$attr = " multiple size=$size";
if (!strpos($name,'[]')) $name .= '[]';
} else if ($size) $attr = " size=$size";
else $attr ='';

But after changing $size=5 to $size=10, it had no effect. I also tried changing

multiple size=$size to multiple size=10. No effect.

The file adodb-lib.inc.php is the only file that contains the term "multiple size" so I think it must be this file.

But I don't have any more ideas.

Anybody else?



sun
Quote Reply
Re: [sun112] How to change the height from categories in admin menu? In reply to
Hi Sun,

Maybe you found this already, but I finally found out myself where it is.

You need to modify the file:

admin/Links/Link.pm

Find the following code in Link.pm and then change the 5 to whatever size you want the category box to be exanded to.

sub get_all_categories {
# -------------------------------------------------------------------
# Returns a select box of all categories.
#
my $self = shift;
my $id = shift;
my $name = shift || 'CatLinks.CategoryID';
my $mult = shift || 5;
my $db = $DB->table ('Category');
my $sth = $db->select ( ['ID', 'Full_Name'] );
my %res = ();
while (my ($id, $name) = $sth->fetchrow_array) {
$res{$id} = $name;
}
return $self->select ( { name => $name, values => \%res, value => $id, multiple => $mult, sort => sub { lc $_[0] cmp lc $_[1] } } );
}



--Frank
Quote Reply
Re: [FrankM] How to change the height from categories in admin menu? In reply to
Thanks a lot!

That works.



sun