Extension:Description2
|
Description2 Release status: stable |
|||
|---|---|---|---|
| Implementation | Data extraction, Parser extension | ||
| Description | Provides a meta description tag and adds data to parser output for other extensions to use. | ||
| Author(s) | Daniel Friesen (Dantmantalk) | ||
| Last version | 0.2 (2011-01-22) | ||
| Database changes | no | ||
| License | GPL2+ | ||
| Download | |||
|
|||
| Check usage and version matrix | |||
Description2 adds a description meta tag for articles automatically based on the content. This functionality appears to have been removed from MediaWiki at some point. There are some situations where description extraction (by entities less sophisticated than Google, like Facebook) will extract the wrong description information from the wiki and use something like the sitenotice as the description for a page instead of its content. This extension was written because Extension:Description looked poorly written, requiring the page to be processed twice (once for the normal output, and again by the extension itself to extract the description), and hardcoding processing looking for things like Image: embedding in ways that don't cope well with international wiki and the change from the namespace's name from Image: to File:. This extension also adds the description to the parser output in a way that other extensions can make use of (to say provide description in a different format like Extension:OpenGraphMeta does, or perhaps to use it in article lists on the wiki).
Installation [edit]
- Download a snapshot and extract it to your extensions directory. Choose the version that matches your version of MediaWiki.
- Add
to the bottom of LocalSettings.php.require_once( "$IP/extensions/Description2/Description2.php" );
- Installation can now be verified through Special:Version of your wiki.
Extra options [edit]
If you set $wgEnableMetaDescriptionFunctions = true; in your LocalSettings.php a <metadesc> tag and a {{description2: parser function can be used to control the description outputted for the page and override it with a custom one. You can use these parser extensions like so:
<metadesc>This is a description</metadesc>
<metadesc content="This is a description" />
{{#description2:This is a description}}
They all do the same thing, <metadesc> is supported so that Description2 can be used as a replacement for Extension:MetaDescriptionTag. The content="" feature was an extra added since it didn't take much to add and was described that way on Extension:MetaDescriptionTag's documentation page even though it appears merely to be a mistake in the examples. You can use the description2 parser function instead of using #tag to provide a description tag you can control with a template's variables.
See also [edit]
- Extension:OpenGraphMeta – uses Description2's description information when installed.
- Extension:ExplicitDescription
- Extension:MetaDescriptionTag