Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Is there an easy to create a custom meta tag in HEAD portion of certain cats only?

Quote Reply
Is there an easy to create a custom meta tag in HEAD portion of certain cats only?
I'd like a custom meta tag in just 2 cats. I wish I could specify it in the EDIT CATEGORY part of the BROWSEr section of Links. But the "Header" goes into the body of the html. Any *simple* way to get it into the <Head>?
Quote Reply
Re: [dwh] Is there an easy to create a custom meta tag in HEAD portion of certain cats only? In reply to
You're best bet, is probably to add a new field(i.e Extra_Meta_Tag) in Database > Category > Properties > Go > Add Field.

Then, enter the value for this in the database, and it should be as simple as putting the following in category.html;

Code:
<%if Extra_Meta_Tag%>
<%Extra_Meta_Tag%>
<%endif%>

The <%Extra_Meta_Tag%> part could probably be put in a pre-defined meta-tag, if you know what its going to be (i.e a http-equiv, or charset, etc).

Hope that helps.

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] Is there an easy to create a custom meta tag in HEAD portion of certain cats only? In reply to
In Reply To:
You're best bet, is probably to add a new field(i.e Extra_Meta_Tag) in Database > Category > Properties > Go > Add Field.

Then, enter the value for this in the database, and it should be as simple as putting the following in category.html;

Code:
<%if Extra_Meta_Tag%>
<%Extra_Meta_Tag%>
<%endif%>

The <%Extra_Meta_Tag%> part could probably be put in a pre-defined meta-tag, if you know what its going to be (i.e a http-equiv, or charset, etc).

Hope that helps.

Cheers

Thanks. I was afraid that was going to be the easiest way. Is there no way in the template to make a conditional by Category IDs? LIKE
<%if CategoryID eq '25' OR CategoryID='22'%>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<%endif%>

NOTE: the actual field is in category and called just "ID"

Last edited by:

dwh: Sep 2, 2004, 1:52 AM
Quote Reply
Re: [dwh] Is there an easy to create a custom meta tag in HEAD portion of certain cats only? In reply to
Quote:
Thanks. I was afraid that was going to be the easiest way. Is there no way in the template to make a conditional by Category IDs? LIKE
<%if CategoryID eq '25' OR CategoryID='22'%>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<%endif%>
NOTE: the actual field is in category and called just "ID"

Sure. Just use;

Code:
<%if ID eq '25' or ID eq '56'%>
....
<%endif%>

... in category.html.

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] Is there an easy to create a custom meta tag in HEAD portion of certain cats only? In reply to
oh. duh. hehe.
Quote Reply
Re: [dwh] Is there an easy to create a custom meta tag in HEAD portion of certain cats only? In reply to
:)

You may also be able to use;

<%if ID == 25 or ID == 56%>

I'm not sure if its faster; as all it needs to do is compare the ID numbers.

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!