Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Category ID on Detailed Page

Quote Reply
Category ID on Detailed Page
I was wondering if by using some global it would be possible to use <%category_id%> or something similar and show category ID on the detailed page of the site.. I would like to use it for below function

<%if% category_id = a>
Meta Tags Here for a
<%elseif category_id = b%>
Meta Tags Here for b
<%elseif category_id = c%>
Meta Tags Here for c
<%elseif category_id = d%>
Meta Tags Here for d
<%elseif category_id = e%>
Meta Tags Here for e
<%else%>
Meta Tags Here in general
<%endif%>

Thanks for the help..

Vishal Thakkar

Vishal
-------------------------------------------------------
Quote Reply
Re: [NeedScripts.Com] Category ID on Detailed Page In reply to
Anyone??

Does anyone knows how to do this?

Thanks for the help.

Vishal Thakkar

Vishal
-------------------------------------------------------
Quote Reply
Re: [NeedScripts.Com] Category ID on Detailed Page In reply to
I think this should give you a category id for a particular link.

sub {
my $tags = shift;
my $id = $tags->{'ID'};
my $db = $DB->table ('Category','CatLinks');

$db->select_options('LIMIT 1');
my $catid = $db->select ( { LinkID => $id }, ['ID'] )->fetchrow_array;
return $catid;
}
Quote Reply
Re: [afinlr] Category ID on Detailed Page In reply to
In Reply To:
I think this should give you a category id for a particular link.

sub {
my $tags = shift;
my $id = $tags->{'ID'};
my $db = $DB->table ('Category','CatLinks');

$db->select_options('LIMIT 1');
my $catid = $db->select ( { LinkID => $id }, ['ID'] )->fetchrow_array;
return $catid;
}
Thanks for the reply.

I am using get_cat_id as the name of the global and am getting error as below on the detailed page where it placed <%get_cat_id%> and it seems to be working :)

But how do I use it in a way where it would work like

<%if get_cat_id = 1%>
Code here
<%elseif get_cat_id = 2%>
Code here
<%elseif get_cat_id =3%>
Code here
<%elseif%>
Code here
<%endif%>

Thanks for the help.

Vishal Thakkar

Vishal
-------------------------------------------------------
Quote Reply
Re: [NeedScripts.Com] Category ID on Detailed Page In reply to
I think you'll need <%if get_cat_id == 1%>
Quote Reply
Re: [afinlr] Category ID on Detailed Page In reply to
In Reply To:
I think you'll need <%if get_cat_id == 1%>


Thanks for the quick reply.. I will check it out and let you know how it worked.

Vishal Thakkar

Vishal
-------------------------------------------------------