Gossamer Forum
Home : Products : Gossamer Links : Discussions :

View all links in sub-categories

Quote Reply
View all links in sub-categories
I am looking for a way to display all the links in a given category and its subcategories at the same time. Then give users the ability to narrow it down to the specific sub-category.

Example...user goes to the "job section" and can see a list of the latest jobs added from all sub-categories in jobs. Yet can also see the links to individual category to narrow it down.

Any suggestions?
Quote Reply
Re: [Soren] View all links in sub-categories In reply to

Mmm.. you could do it with a custom script. Something along these lines;

my $catID = 111; # set as the category you wanna ge sub-cats of

my $catids = $DB->table('Category')->children($catID); # business

my $tbl = $DB->table('CatLinks','Links');

my $sth = $tbl->select( ['Links.Photo','Links.ID'] , GT::SQL::Condition->new ('CatLinks.CategoryID', 'IN', $catids, 'isValidated', '=', 'Yes' ) ) || die $GT::SQL::error;

while (my $hit = $sth->fetchrow_hashref) {
# you have access to all values from glinks_Links and glinks_CatLinks here - so would need to get the values from glinks_Category seperatly

I can't afford the time to write the whole thing for you I'm afraid - spent too much of my Xmas hol's helping people out this year Tongue

Hope that helps though.


Andy (mod)
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!