YES ... problem sorted (fingers-crossed!!)
I'd previously played around for hours trying to link just the last part of the category and ended up building an additional sub to link the last directory using (pop @dirs)
After testing a few backup copies I found the problem had been there ever since I did the mod (ooppss ...) I've now removed the sub altogether and used the following changes to achieve it:
# --------------------------------------------------------
# Returns a string of the current category broken up
# by section, with each part linked to the respective section.
#
my $input = shift;
my (@dirs, $dir, $output, $path);
@dirs = split (/\//, $input);
# Builds all but the last directory, without a hyper-link
for (0 .. $#dirs - 1){
$path = "/" . &build_clean_name( join "/", @dirs[0 .. $_] );
$output .= qq| $dirs[$_] >|;
}
# Builds the last directory, hyper-linked
for ($#dirs){
$path = "/" . &build_clean_name( join "/", @dirs[0 .. $_] );
$output .= qq| <A HREF="$LINKS{build_root_url}$path/">$dirs[$#dirs]</A>|;
}
return $output;
}Thanks pugdog - your advice about $#dirs gave me the idea to get it working
All the best
Shaun
I'd previously played around for hours trying to link just the last part of the category and ended up building an additional sub to link the last directory using (pop @dirs)
After testing a few backup copies I found the problem had been there ever since I did the mod (ooppss ...) I've now removed the sub altogether and used the following changes to achieve it:
Code:
sub search_build_linked_title { # --------------------------------------------------------
# Returns a string of the current category broken up
# by section, with each part linked to the respective section.
#
my $input = shift;
my (@dirs, $dir, $output, $path);
@dirs = split (/\//, $input);
# Builds all but the last directory, without a hyper-link
for (0 .. $#dirs - 1){
$path = "/" . &build_clean_name( join "/", @dirs[0 .. $_] );
$output .= qq| $dirs[$_] >|;
}
# Builds the last directory, hyper-linked
for ($#dirs){
$path = "/" . &build_clean_name( join "/", @dirs[0 .. $_] );
$output .= qq| <A HREF="$LINKS{build_root_url}$path/">$dirs[$#dirs]</A>|;
}
return $output;
}
All the best
Shaun