Page 1 of 1

Static pages with individual meta-tag "description"

Posted: Thu Apr 05, 2007 9:31 pm
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!

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

Posted: Thu Apr 05, 2007 10:37 pm
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

Posted: Wed May 23, 2007 9:59 pm
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