Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Shortening the category crumb indicator

Quote Reply
Shortening the category crumb indicator
Hi I was wondering if anybody had any ideas on how to have the category crumb indicator set to a maximum of characters and being able to take out middle parts of the category crumb, replacing with "..."

Thus :
Destination > Americas > Canada
would be reduced to :
Destination > ... > Canada

and :
Destination > Americas > Canada > Montreal
would be reduced to :
Destination > ... > Montreal

At the moment I'm using this code (part from the forum) to list links and display the appropriate category.

This an extract :

Code:
# Get the links category information
my $catdb = $DB->table('CatLinks', 'Category');
my $catsth = $catdb->select ({ 'LinkID' => $link->{ID} }, ["Full_Name"]);
# This is the normal line
$link->{category} = $catsth->fetchrow_array;
# Replace the / with >
$link->{category} =~ s|/|&nbsp\;&gt\;&nbsp\;|g;

I'd like to have the categories displayed but only with a maximum number of characters...

Thanks John
Significant Media