Gossamer Forum
Quote Reply
link category
i need to have global like a title_unlinked for link at category page.

for example my link located it Cat/Cat1/Cat2

at category page(not only category but all where i will use links) i need:

Link title1.

category: Cat/Cat1/Cat2



Link title2.

category: Cat3/Cat3/Cat3



etc.



i remember links 2 have this mod.

but dont know enything about links sql.

guys, please help.
Quote Reply
Re: [romanslon] link category In reply to
sub {
my ($rec) = @_;
my $linkid = $rec->{ID};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $linkid }, ['Category.Full_Name'] );
my $cat;
while (my ($full_name) = $sth->fetchrow_array) {
$cat .= "<li>".Links::Build::build('title_unlinked', $full_name);
}
return $cat;
}
The UK High Street
Quote Reply
Re: [afinlr] link category In reply to
thanks!

but it generate me clear(title_unlinked) list like:

some category/some category

i need:

some_category/some_category

becase i planing use it for link url.



please help.
Quote Reply
Re: [romanslon] link category In reply to
sub {
my ($rec) = @_;
my $linkid = $rec->{ID};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $linkid }, ['Category.Full_Name'] );
my $cat;
while (my ($full_name) = $sth->fetchrow_array) {

my $test = Links::Build::build('title_unlinked', $full_name);

$full_name =~ s/ /_/g;
$cat .= qq~<a href="$CFG->{build_root_url}/$full_name/index.html">$test</a>~;
}
return $cat;
}