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

Products: Gossamer Links: Development, Plugins and Globals: Re: [AMIXIMA] How to show parent category links in child category pages: Edit Log

Here is the list of edits for this post
Re: [AMIXIMA] How to show parent category links in child category pages
Ok, I think I understand what you want. I guess the easiest way is to add a new field via Database > Category > Properties > Add Field:

RelatedCatID / INT

Then enter the category ID. Then add a new global:

get_related_from_catid
Code:
sub {
my $link_db = $DB->table('Links','CatLinks');
my $cat_id = $_[0];
my $limit = 50;

my @output;
$link_db->select_options ('ORDER BY Title', "LIMIT $limit");

my $sth = $link_db->select ( { CategoryID => $cat_id }) || die $GT::SQL::error;


while (my $link = $sth->fetchrow_hashref) {
$link = Links::SiteHTML::tags('link', $link);
push @output, $link;
}

return { extra_links_loop => \@output }
}

Call with:

Code:
<%if RelatedCatID%>
<%get_related_from_catid($RelatedCatID)%>
<%if extra_links_loop.length%>
<%include link.html%>
<%endif%>
<%endif%>

Hopefully thats what your after ;) (totally untested!)

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!

Last edited by:

Andy: Jul 23, 2013, 12:12 PM

Edit Log: