Multiple (:keywords:) and (:description:) directives generate multiple <meta> tags in the HTML, is there a way to merge them into single entries?
This recipe is obsolete, equivalent functionality is provided by the PmWiki core from version 2.1.beta37 onwards.
Why would I have multiple (:keywords:) or (:description:) in my pages?
It would be useful, for example, to place in a GroupHeader the keywords and description that are common to the whole group, and in every page the keywords and description which are specific for that page.
Why is it useful to merge the meta tags?
It is useful, or even necessary, to have single meta tags entries in the final HTML because most search engines will ignore multiple meta tags with the same name, or even detect it as a spamming technique.
Download the script from above and place it in your cookbook directory. Then add
include_once('cookbook/mergemetatags.php'); in your local configuration (local/config.php).
No configuration is necessary. Just install it and it will work automatically.
The script will work automatically without any change in the wiki markup. Any occurrence of multiple (:keywords:) or (:description:) in the same rendered page will be merged in the final HTML.
The recipe will internally include the script
stdmarkup.php, so in your local
config.php anything that should be before (or after)
stdmarkup.php place it before (or after) the MergeMetaTags recipe.
If for example your site needs utf-8 you have to include the script
xlpage-utf-8.php before including
mergemetatags.php recipe script.
- 0.1 - 23.01.2006
- First implementation.
- PITS.00624 about multiple (:keywords:).
- Blues, original script