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.
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.