Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Category Name On detailed page

Quote Reply
Category Name On detailed page
Does anyone know how to put the category name in the page title on the detalied page?
Jason Bishop

Quote Reply
Re: [netnow] Category Name On detailed page In reply to
Hi,

Think you have to use a global.

Code:
sub {
my $rec = $DB->table('CatLinks','Category')->select( { LinkID => $_[0] } )->fetchrow_hashref;
return $rec->{Full_Name};
}
..and call with:

Code:
<%global_name($ID)%>

Totally untested, but should work =)

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!
Quote Reply
Re: [Andy] Category Name On detailed page In reply to
Wink

Worked like a charm!

Thank You very much!
Jason Bishop

Quote Reply
Re: [Andy] Category Name On detailed page In reply to
HiSmile
I want to display in the details page list of all categories that are in the same level.
I try a lot of Globals in the forum, but they don’t work.
I am using Version: 3.2
Quote Reply
Re: [nir] Category Name On detailed page In reply to
nir wrote:
HiSmile
I want to display in the details page list of all categories that are in the same level.
I try a lot of Globals in the forum, but they don’t work.
I am using Version: 3.2
Hi,

A list of other links in the same category, or other subcategories?

i.e if a link is in the category:

Code:
Test/Foo/Bar

..and these other categories exist:
Code:
Test/Foo/Bar 2
Test/Foo/Bar 3
Test/Foo/Bar 4
Test/Foo/Bar 5
Test/Foo/
Test/Bla
Test/Bla/Bar

..you would want only these to show up on the detailed page:

Code:
Test/Foo/Bar 2
Test/Foo/Bar 3
Test/Foo/Bar 4
Test/Foo/Bar 5

...correct? If so, thats possible - just wanted to make sure its what you are after :P

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!
Quote Reply
Re: [Andy] Category Name On detailed page In reply to
Hi Andy
Yes, this is correct; I want to display list of categories in the same level.
Quote Reply
Re: [nir] Category Name On detailed page In reply to
Hi.

Try this:

Code:
sub {

# get the category this link is in...
my $rec = $DB->table('CatLinks','Category')->select( { LinkID => $_[0] } )->fetchrow_hashref;

my @loop;
my $sth = $DB->table('Category')->select( { FatherID => $rec->{FatherID} } ) || die $GT::SQL::error;
while (my $hit = $sth->fetchrow_hashref) {
$hit->{url} = $DB->table('Category')->as_url( { ID => $hit->{ID} } );
push @loop, $hit;
}

return { cats_lower => \@loop }
}

Call with:

Code:
<%global_name($ID)%>
<%loop cats_lower%>
<a href="<%url%>"><%Full_Name%></a>
<%endloop%>

Again, totally untested - but should work :) (still a bit tired :P)

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 12, 2007, 3:00 AM
Quote Reply
Re: [Andy] Category Name On detailed page In reply to
I get this error
Unable to compile 'cat_link_Detailed': Type of arg 1 to push must be array (not private variable) at (eval 36) line 10, at EOF
Quote Reply
Re: [nir] Category Name On detailed page In reply to
Hi,

Sorry, please try the edited version =)

This bit:

Code:
push $hit, @loop;

...should have been:

Code:
push @loop, $hit;

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!
Quote Reply
Re: [Andy] Category Name On detailed page In reply to
It Work!!!Smile
ThanksCool

Just one thing- How can I order the category by ABC if the language is not English?
Quote Reply
Re: [nir] Category Name On detailed page In reply to
Hi,

You could try this:

Code:
sub {

# get the category this link is in...
my $rec = $DB->table('CatLinks','Category')->select( { LinkID => $_[0] } )->fetchrow_hashref;

my @loop;
my $tbl = $DB->table('Category');
$tbl->select_options('ORDER BY Name DESC');
my $sth = $tbl->select( { FatherID => $rec->{FatherID} } ) || die $GT::SQL::error;

while (my $hit = $sth->fetchrow_hashref) {
$hit->{url} = $DB->table('Category')->as_url( { ID => $hit->{ID} } );
push @loop, $hit;
}

return { cats_lower => \@loop }
}

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!
Quote Reply
Re: [Andy] Category Name On detailed page In reply to
When I use 'RDER BY Name DESC' it is order the category with exception, something like- ABFGCG.
Thanks a lot for your help.