Providing the “description” meta tag is widely known as a good SEO practice. On top of that, it helps differentiate site’s pages, which prevents search engines from seeing them as duplicated content. It becomes then especially useful in a very special case of blogs. This plugin generates such a meta tag basing on the first words of the article, ending the quotation with horizontal ellipsis (…).
The plugin provides the
<txp:art_meta_description /> tag that should be placed in the
<head> of the page.
The plugin is designed to work on articles (where adding the “description” meta tag is virtually useful). Thus, there is no use of placing it on the pages that do not show single articles. However, the plugin won’t do any harm in that case – it will simply output nothing.
A few options are available to allow user to customise the plugin.
- determines how many words are used to generate the tag. The default value is 25.
- determines the maximum number of characters (including the ellipsis) in the content of the generated tag. It is important because of search engines limits (too long descriptions could be banned). If the text that consist denoted number of words is too long, it is being automatically shortened to fit in allowed number of characters. The default value is 250.
- allows to use the content of the article body instead of the excerpt, which is the default behaviour. Nevertheless, if the article excerpt turns out to be empty, the article body will be used, so there is no need to use this option if the excerpt is not present. The defalut value is
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <txp:art_meta_description words="20" maxchars="150" prefercontent="true" /> <!-- the rest of the head goes here --> </head>
The above example shows heavily customised usage of the tag. The plugin will take first 20 words of the article body (but not more than 150 characters).
The plugin is designed with Unicode support in mind, but it was tested only with Polish texts. All reports concerning other languages, as well as bugs and feature requests are very welcome.
Archived [?]: orphaned: broken links