Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Breadcrumb Separation

Quote Reply
Breadcrumb Separation
Hi,

The title_linked fucntion produces a breadcrumb using a colon (:) as a separator but I want to use the > symbol to match with the breadcrumb generated by other software on my site.

I have had a look at the build_title_linked sub in build.pm but I am not sure which bit to change!
Code:

sub build_title_linked {
# ------------------------------------------------------------------
# Generate a linked title.
#
my $input = shift;
my $complete = 0;
my $home = 1;
if (ref $input) {
$complete = $input->{complete} || 0;
$home = defined $input->{home} ? $input->{home} : 1;
$input = $input->{name};
}
my (@dirs, $dir, $output, $path, $last, $db, $top);

$db = $DB->table('Category');
$top = Links::language('LINKS_TOP') || 'Top';
@dirs = split (/\//, $input);
$last = pop @dirs unless ($complete);
$output = $home ? qq| <a href="$CFG->{build_root_url}/$CFG->{build_index}">Catalogue</a> :| : '';
for (0 .. $#dirs) {
$path = "/" . $db->as_url ( join "/", @dirs[0 .. $_] );
$output .= qq| <a href="$CFG->{build_root_url}$path/$CFG->{build_index}">$dirs[$_]</a> :|;
}
if ($complete) {
chop $output; chop $output;
}
else {
$output .= " $last";
}
return $output;
}
END_OF_SUB


Many Thanks
Alex



Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery
Quote Reply
Re: [IndigoClothing] Breadcrumb Separation In reply to
I would recommend using a global.

<%global_name($title_linked)%>

Code:
sub {
my $_in = $_[0];
$_in =~ s/ : / &gt; /g;
return $_in;
}

Much better than modifying the actual .pm files (as this can cause upgrade problems).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Breadcrumb Separation In reply to
That is so clever - thanks!

Alex



Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery

Last edited by:

IndigoClothing: Mar 5, 2004, 3:02 AM
Quote Reply
Re: [Andy] Breadcrumb Separation In reply to
That's a great global solution Andy. Thanks very much for posting it for everyone. Does anyone know if there is a way to modify it to allow an image as a separator? I tried:

Code:

sub {
my $_in = $_[0];
$_in =~ s/ : / <img src="/images/red_arrow.gif"> /g;
return $_in;
}


But it didn't like that and wouldn't work. I think the problem was from the slashes in the image path. Does anyone know if there is a way to include an image with the path in this global?

--FrankM
Quote Reply
Re: [FrankM] Breadcrumb Separation In reply to
No problem :)

You should be able to use;

Code:

sub {
my $_in = $_[0];
$_in =~ s|\Q : | <img src="/images/red_arrow.gif"> |g;
return $_in;
}

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Breadcrumb Separation In reply to
Wow, that was quick! Just tested it and it worked perfectly. Thanks very much Andy.

--FrankM
Quote Reply
Re: [FrankM] Breadcrumb Separation In reply to
Quote:
Wow, that was quick!

Yeah.. I wanna get off for a pint Tongue

Quote:
Thanks very much Andy.

No problem.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!