Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Categories on search result page

Quote Reply
Categories on search result page
I would like to show category (under EACH link) .

Something like:

Title

Description

Found in CATEGORY

build_search_gb is set to No ...

Thank You!
Quote Reply
Re: [Payooo] Categories on search result page In reply to
See: http://www.gossamer-threads.com/...i?post=152224#152224

Wink


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Categories on search result page In reply to
Thanks Ian Wink

But that displays all subcategories, while i need only the last one ...

I have tried to modify some parts of it but with no luck Pirate
Quote Reply
Re: [Payooo] Categories on search result page In reply to
I have a global get_link_cats that puts the category information into a loop:
Code:
sub {

my $tags = shift;

my $id = $tags->{ID};
my $cat_db = $DB->table('Category');
my $catlink = $DB->table('CatLinks','Category');
my %names = $catlink->select ('LinkID', 'Full_Name', { LinkID => $id })->fetchall_list;

my @link_cats;
foreach (keys %names) {
push @link_cats, {cat_name => Links::Build::build ('title_unlinked', $names{$_}), cat_url => $cat_db->as_url($names{$_})};
}
$tags->{link_cats} = \@link_cats;
return $tags;
}
It is called in links.html, using
Code:
<%get_link_cats%>
<%loop link_cats%>
<dd><small>Category: <a href="<%cat_url%>"><%cat_name%></small></dd>
<%endloop%>
This should work.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Categories on search result page In reply to
Hi yogi

This one doesn't help me either. It has a bug with "cat_url".

It prints Category/SubCategory1/SubCategory2/Category/SubCategory1/SubCategory2/Category

and versions of it depending in which subcategory you look ...

And also has long TITLE - I need only the last subcategory printed ...

Thank you! Wink

Any other solution?


UPDATE: It's working fine if you are using it on search results page, on category pages it still produces errors

with link to proper category ...

Last edited by:

Payooo: Jul 2, 2002, 8:21 AM