|
MetaTag<< | Cookbook-V1 | >> Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.
GoalAdding page related meta tags to a page
SolutionSite (and group metatags)This can be solved with something like the code in the following box:
How to keep robots away.=note Note: PmWiki version 0.6 already has built-in features for controlling robots. See the scripts/stdconfig.php file and the The robots page describes the usage of the robots.txt file to control web-robots. However the used wildcards in the examples are not defined by the robots exclusion definition. Allthought it works for most robots. Following is an example on using metatags to control robots:
Per page metatagsThe attached code is an addition to add meta tags to single pages Installation
UsageAdd the tag:
between your page text, doesn't matter where in the text, it will translate to:
Add the tag:
between your page text, doesn't matter where in the text. The 'where' must be defined in your metatag.php, this to avoid nasty redirects (consider a page named ForKids and a redirect to www.nastypictures.com) Time is set to 1 when omitted. It will translate to:
ExamplesIt solves most robot related meta tags:
results in:
History
Comments, BugsI get the following errors with this plugin: Warning: array_push(): First argument should be an array in /home/grainof/public_html/local/metatag.php on line 81 Thanks, Oneida Kincaid 01/25/2004 solved in version 1.10 Thanks for the quick fix, it works like a charm now! Thanks for a great plugin. Oneida This plugin works like a charm with PmWiki 1.0.5 in terms of giving you per-page keyword and description metatags if you put <!--function:PrintMetaTags--> in the header section of your template. It took me a little while to figure that out, so I thought I mention it for those who would like to use it with more recent versions of PmWiki. Oneida Kincaid 07/26/2004 Just thought I'd add a link from here to PmWiki/MarkupMasterIndex since I wasted a bunch of time trying to use this recipe to do metatags in v2 before I found the proper directive on that page... shi September 04, 2005, at 11:30 PM Contributors--- pmwiki-2.2.0-beta68 -- Last modified by {{shi}}
|