Pat_tile, a plugin for your articles title Print

Accès au site français

The rise of HTML5 introduces lot of new elements for markup. Some are dedicated for titles as the Microdata attributes or Microformat. What about if you want to benefit of it? Actually, your prefered CMS doesn't allow markup adding directly into the title input and/or you can't imagine loosing the simple way to write headings.

This Textpattern CMS plugin made for the french editor Alexipharmaque éditions website allows to add some specifics attributes and properties into your headings by cutting parts of the text based on a delimiter included into your article titles.

Plugin help content:

Usage

In remplacement of the <txp:title /> tag:

<txp:pat_title adjustment=" " limiter=" " break=" " replacement=" " tag1=" " itemprop1=" " class1=" " tag2=" " itemprop2=" " class2=" " />

All attributes are explained just below.

Attributes

  • exclude: a sign to check if it is present into the title. If set, do nothing. Default: none (empty).
  • limiter: the final text character where to apply the first part. Default: none (empty).
  • adjustment: integer. Correction to apply before the limiter if the result isn't good. Default: 0 (no correction).
  • break: an individual HTML tag to break the first part. Default: br.
  • replacement: entity used to add a no widow effect just before the limiter character.
  • tag1: HTML tag which wrap the first part of the title. Default: span.
  • itemprop1: content of the first itemprop attribute. Default: empty (none).
  • class1: class attribute applied to the first tag (tag1). Default: empty (none).
  • tag2: HTML tag which wrap the second part of the title. Default: span.
  • itemprop2: content of the second itemprop attribute. Default: empty (none).
  • class2: class attribute applied to the second tag (tag2). Default: empty (none).

Example

<txp:pat_title adjustment="2" limiter="»" break="br" replacement=" " tag1="em" itemprop1="headline" class1="title" tag2="span" itemprop2="editor" class2="fn" />

In this example, the article title « Textpattern Solutions » friends of ED editor will be transformed like that:

<em itemprop="headline" class="title">« Textpattern Solutions »</em> <br /> <span itemprop="editor" class="fn"> friends of ED editor</span>

pat_title is available here: Download this plugin.

 

Published on | Updated on by Patrick LEFÈVRE.

Related Articles

Control you blank pages - Publié le 2011.12.22 By Patrick LEFÈVRE.
Split your links list into columns - Publié le 2011.12.14 By Patrick LEFÈVRE.
Display a page on your website for known referrers - Publié le 2012.02.09 By Patrick LEFÈVRE.
Compress your CSS & javascript files - Publié le 2012.01.09 By Patrick LEFÈVRE.
Access to all article archives

» Previous Article» Next Article
txp:fr supports Textpattern ;·) Textpattern CMS

Need Help? Post your question on Entr'Aide txp:fr website