T3SEO

TYPO3 and SEO since 2011

EXT:widont

The concept of Widon't is explained in Shaun Inman's Blog. Here's a short summary and the implementation as TYPO3 extension.

Widon't

Widon't is made up from the words widow and don't. In typography a widow is the last word of a text, which appears in the last line on its own.

To prevent this unwanted behaviour a non breaking space is inserted between the last two words of a paragraph, so that they will break into a new line together.

TYPO3 Extension widont

After installing the TYPO3 Extension widont and including the Static Extension Template the Widon't parsing will be applied to headlines (lib.stdheader) and texts (tt_content.text.20) by default. You can enable and disable the parsing in the constant editor.

If you need more fine-grained options or want to use widont in your Extension or TypoScript Templates you can use the the new stdWrap property .widont.

lib.myHeadline = TEXT
lib.myHeadline {
  value = foo bar baz
  widont = 1
  wrap = <h1>|</h1>
}
# Output: <h1>foo bar&nbsp;baz</h1>
 
lib.moodyText = TEXT
lib.moodyText {
  field = description
  widont.if.value = 1
  widont.if.equals.cObject = TEXT
  widont.if.equals.cObject {
    data = date:U
    strftime = %u
  }
}
# Applies widont only on mondays ;)
 
lib.longText = TEXT
lib.longText {
  field = description
  widont = 1
  widont.splitParagraphs.char = 10
}
# Splits the text by line breaks (\n = ASCII 10) and
# applies widont to each paragraph

widont needs TYPO3 version 6.0. If you feel like implementing backwards compatibility for TYPO3 4.x, you're welcome to do so and start a pull request.

You can get widont from the TER or GitHub.

EXT:widont

    Related Topics

  • Extensions