Static pages with individual meta-tag "description"

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
aschlemmer
Regular
Posts: 70
Joined: Fri Feb 23, 2007 6:13 pm
Location: Freiburg/Germany
Contact:

Static pages with individual meta-tag "description"

Post by aschlemmer »

Now that I'm using custom fields for every entry to fill the meta-tags description and keywords for every single entry page, I have two more needs:

The first one, using custom fields for static pages was discussed in this thread, unfortunately resulting in a recipe that doesn't work for meta-info. Is there a way (I have 3 static pages) to give them individual meta-descriptions? As you may know, Google starts using the meta-description for the serach result abstract text, at least when the site is somewhat "serious" (what I'm trying to be :-))

Second, I'd like to use a fixed set of meta-descriptions for the category pages -- here I have no idea on how to deal with that ... does somehave has a hint for me? Thanks for your input and ... happy holidays!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Static pages with individual meta-tag "description&

Post by garvinhicking »

Hi!

For the staticpages, you could basically edit your index.tpl template and check the {$staticpage_pagetitle} variable via smarty what it is, and then hard-code the appropriate meta-tags into the index.tpl file?

The other option would be to "abuse" a content field like "preface" in the staticpages to put your meta-content there, and read it out in the index.tpl file.

Adding custom fields to static pages is hard, as explained in the other topic. It would need some serous PHP-editing of the plugin.
Second, I'd like to use a fixed set of meta-descriptions for the category pages -- here I have no idea on how to deal with that ... does somehave has a hint for me? Thanks for your input and ... happy holidays!
Same as above, you could edit your index.tpl template and query what the $category (or was it $category_info? You might need to look up the Variable documentaiton on www.s9y.org) and then make {if} checks to emit the appropriate meta-tags. This will all blow up your index.tpl file, but I see no real other way.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
aschlemmer
Regular
Posts: 70
Joined: Fri Feb 23, 2007 6:13 pm
Location: Freiburg/Germany
Contact:

Post by aschlemmer »

Thanks -- it worked like a charm.

Simply added:

Code: Select all

{elseif $staticpage_pagetitle}MS-Reporter.de: {$staticpage_pagetitle}
and received a correct title or meta-description -- just what I liked.

Serendipity is SE_friendly but with building some Smarty queries, it's a SE booster. Great job with s9y!

Achim
www.ms-reporter.de
Pharma-unabhängige Infos für Multiple Sklerose-Betroffene
schnellze.it
Einzigartiges Zusammenspiel aus Popfetcher und s9y
Post Reply