Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [Andy] title_linked in Detail Pages

Quote Reply
Re: [Andy] title_linked in Detail Pages In reply to
Try this (global adapted slightly from pugdog's post here):

<div><%linked_title ($ID,$Title,'>',2,0)%></div>

then create the the linked_title global:

Code:
sub {
# ------------------------------------------------------------------
# Generate a linked title.
#
# call with <%linked_title ($LinkID, $Title, ':', 0, 0)%>
# where the first two parameters are required, and you can
# add parameters 3, 4 and 5 in order
#
my $id = $_[0];
my $input = $_[1];
my $separator = $_[2] || ':';
my $home = $_[3] || 0;
my $complete = $_[4] || 0;

my (@dirs, $dir, $output, $path, $last, $db, $top);

$db = $DB->table('Category');
$top = Links::language('LINKS_TOP') || 'Top';

my ($cat_id, $cat_name) = %{$DB->table('Links')->get_categories ($_[0])};
$input = "$cat_name/$_[1]";

@dirs = split (/\//, $input);
$last = pop @dirs unless ($complete);
$output = $home ? qq| <a href="/">$top</a>&nbsp;$separator| : '';
for (0 .. $#dirs) {
$path = "/" . $db->as_url ( join "/", @dirs[0 .. $_] );
$output .= qq| <a href="$CFG->{build_root_url}$path/$CFG->{build_index}">$dirs[$_]</a>&nbsp;$separator|;
}
if ($complete) {
chop $output; chop $output;
}
else {
$output .= " $last";
}
$output=~ s/ & / &amp; /sg;
return $output;
}

Can't remember what parameters 4 and 5 do exactly but this should get you started :).
Subject Author Views Date
Thread title_linked in Detail Pages Clint 3729 Feb 9, 2008, 4:52 AM
Thread Re: [Clint] title_linked in Detail Pages
Andy 3624 Feb 9, 2008, 5:57 AM
Thread Re: [Andy] title_linked in Detail Pages
Clint 3616 Feb 9, 2008, 2:54 PM
Thread Re: [Clint] title_linked in Detail Pages
Andy 3626 Feb 10, 2008, 5:16 AM
Post Re: [Andy] title_linked in Detail Pages
aus_dave 3605 Feb 11, 2008, 5:17 PM