Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [nir] Category path in categoey.html

Quote Reply
Re: [nir] Category path in categoey.html In reply to
You need a new global.

Code:
sub {
my ($table, $sth, $catID, $cattable, $sth2, $name, @dirs, $output, $i);

$cattable = $DB->table('Category');
$name = $cattable->select ( ['Full_Name'], { ID => $_[0] } )->fetchrow;
@dirs = split (/\//, $name);
$i = 0;
for (0 .. $#dirs) {

if ( $i == '0') {
my $path = "/" . $cattable->as_url( join "/", @dirs[0 .. $_] );
$output .= " <a href=\"=\"http://www.mysite/\">$dirs[$_]</a> &nbsp;"; $output .= " > ";
$i++;
next;
}
my $path = "/" . $cattable->as_url( join "/", @dirs[0 .. $_] );
$output .= " <a href=\"http://www.mysite/$path/$CFG->{'build_index'}\">$dirs[$_]</a> &nbsp;";
$output .= " > " if $i < $#dirs;
$i++;

}
return $output;
}

Call with:

<%global_name($ID)%>

Untested, but should work.

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!
Subject Author Views Date
Thread Category path in categoey.html nir 5027 May 18, 2009, 7:42 AM
Thread Re: [nir] Category path in categoey.html
Andy 5011 May 18, 2009, 8:36 AM
Thread Re: [Andy] Category path in categoey.html
nir 4950 May 19, 2009, 1:16 AM
Thread Re: [nir] Category path in categoey.html
Andy 4926 May 19, 2009, 2:03 AM
Thread Re: [Andy] Category path in categoey.html
nir 4915 May 19, 2009, 4:40 AM
Thread Re: [nir] Category path in categoey.html
Andy 4921 May 19, 2009, 5:02 AM
Post Re: [Andy] Category path in categoey.html
nir 4896 May 19, 2009, 5:45 AM