MergeMetaTags

Summary: A way to merge multiple meta tags into single entries
Version: 0.1 (23 January 2006)
Prerequisites: Probably requires at least PmWiki version: 2.0; last tested on PmWiki version: 2.1.beta22
Status:
Maintainer:
Categories: Obsolete

Question

Multiple (:keywords:) and (:description:) directives generate multiple <meta> tags in the HTML, is there a way to merge them into single entries?

Answer

This recipe is obsolete, equivalent functionality is provided by the PmWiki core from version 2.1.beta37 onwards.

It is possible with mergemetatags.phpΔ.

Notes

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.

Installation:

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).

Configuration:

No configuration is necessary. Just install it and it will work automatically.

Use:

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.

Notes:

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.


Releases

  • 0.1 - 23.01.2006
    • First implementation.

Comments


See Also


Contributors

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.