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

Cat description on Detailed Page

Quote Reply
Cat description on Detailed Page
I know to bring the field Description from the category to a detailed page; but i dont understand why we have all other fields from the category automaticly there but not this one.

Maybe a problem of two times the name Description in category and links?

May someone tell my the rows in the scripts where i can find and resolve it?
It makes no sense for me to have an extra plugin, when there is a select * from cat somewhere.

Last edited by:

Robert: Dec 12, 2009, 11:38 AM
Quote Reply
Re: [Robert] Cat description on Detailed Page In reply to
The problem is here (nph-build.cgi, line 553):

Code:
# Only select Category columns that don't conflict with Links columns.
my @cat_cols = grep !$links_cols{$_}, keys %{$DB->table('Category')->cols};
my $sth = $rel->select('Links.*', @cat_cols, 'CategoryID' => $cond);


May someone has an idea how to add:

category.Description as description?

Then everything should be done.

Last edited by:

Robert: Dec 12, 2009, 12:03 PM
Quote Reply
Re: [Robert] Cat description on Detailed Page In reply to
sorry, have posted this in the wrong forum. it is a question for LSQL, maybe someone could moveit, please.
Quote Reply
Re: [Robert] Cat description on Detailed Page In reply to
Np - I've moved it for you.

So if I'm right, you wanna get the category description, on the detailed page? Should be pretty simple:

get_cat_desc_for_detailed
Code:
sub {
my $cat_id = $DB->table('CatLinks')->select( ['CategoryID'], { LinkID => $_[0] } )->fetchrow;
my $cat_desc = $DB->table('Category')->select( ['Description'], { ID => $cat_id } )->fetchrow;
return { Category_Description => $cat_desc };
}

Then call in detailed.html with:

Code:
<%get_cat_desc_for_detailed ($ID)%>
Cat Description is: <%Category_Description%>

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!