Gossamer Forum
Home : Products : Gossamer Links : Discussions :

breadcrumb seperator

Quote Reply
breadcrumb seperator
I'm currently using a global format_title_override as below:

sub {
my ($title_loop, %options) = @_;
return unless $title_loop; my %vars = %{GT::Template->vars};
my $ret;
$options{separator} = GT::CGI::html_escape($options{separator}) unless $options{no_escape_separator};
for (0 .. $#$title_loop) {
next unless $_ or $options{include_home};
if ($options{link_type} == 1 or
($options{link_type} == 2 and $_ != $#$title_loop)) {
$ret .= qq|<a href="$title_loop->[$_]->{URL}">$title_loop->[$_]->{Name}</a>|;
}
else {
unless ($options{no_last} == 1 and $_ == $#$title_loop) {
$ret .= $title_loop->[$_]->{Name};
}
}
$ret .= $options{separator} unless $_ == $#$title_loop;
}
if ($options{link_type} == 3) {
$ret = qq|<a href="$title_loop->[-1]->{URL}">$ret</a>|;
}
return \$ret;
}

and I use no_last=>1 to drop the title at the end of the breadcrumb.

<%format_title_override($title_loop, separator => $crumb_separator, no_escape_separator => 1, include_home => 0, link_type => 2, no_last=>1)%>

however, it still shows the separator at the end of the final link. I want to keep the separator between the links, but not after the final link. does anyone have a good idea?

thanks.
Quote Reply
Re: [joeybone] breadcrumb seperator In reply to
Hi,

You tried something like this (before it "returns");

Code:
if ($options{no_last}) {
$ret =~ s/$options{seperator}$//;
}

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 seperator In reply to
Thanks for the quick reply.

I've tried what you suggested but I'm not sure exactly where to insert that in the code. I've put it in several places to no avail. Where exactly would it go?

thanks.
Quote Reply
Re: [joeybone] breadcrumb seperator In reply to
Hi,

Try it before:

return \$ret;

If not, try doing a print out of the value - so you can see exactly what it is:

print qq|"$ret"|;

(leave the quotes in there)

Then, goto the page where it loads - and then tell me exactly whats showing between the quotes (it may be there is an extra space in there which you need to accomidate for)

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 seperator In reply to
thanks.

i tried all that, but separator is still there, and nothing printed out:

http://www.orbweb.net/smba/website/directory/Detailed/1.html

I appreciate your help, any other ideas?

cheers.
Quote Reply
Re: [joeybone] breadcrumb seperator In reply to
Mmm, what if you try:

$ret =~ s/$options{seperator}\s+$//;

?

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 seperator In reply to
all that did was take a space out after the separator; separator is still there.

cheers.
Quote Reply
Re: [joeybone] breadcrumb seperator In reply to
Can you send over Glinks admin details, and I'll have a qucik look? Bit hard trying to diagnose it without seeing whats actually going on :)

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: [joeybone] breadcrumb seperator In reply to
Should work now. Was a mis-spelling for "separator" (had an "e" instead of an "a" =))

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 seperator In reply to
Thanks Andy for your help.

here's the working result:

sub {
my ($title_loop, %options) = @_;
return unless $title_loop; my %vars = %{GT::Template->vars};
my $ret;
$options{separator} = GT::CGI::html_escape($options{separator}) unless $options{no_escape_separator};
for (0 .. $#$title_loop) {
next unless $_ or $options{include_home};
if ($options{link_type} == 1 or
($options{link_type} == 2 and $_ != $#$title_loop)) {
$ret .= qq|<a href="$title_loop->[$_]->{URL}">$title_loop->[$_]->{Name}</a>|;
}
else {
unless ($options{no_last} == 1 and $_ == $#$title_loop) {
$ret .= $title_loop->[$_]->{Name};
}
}
$ret .= $options{separator} unless $_ == $#$title_loop;
}
if ($options{link_type} == 3) {
$ret = qq|<a href="$title_loop->[-1]->{URL}">$ret</a>|;
}
$ret =~ s/$options{separator}$//;
return \$ret;
}