title
From Textpattern CMS User Documentation
<txp:title />
The title tag is a single tag which is used to return the title of the article being displayed. It is usually used in an article form.
Contents |
Attributes
Tag will accept the following attributes (case-sensitive):
- no_widow="boolean"
- Control widows and overrule widows setting in Advanced Preferences.
- Values:
- 0 - allow the last word in the title to appear on its own line, i.e. the title content is rendered unchanged
- 1 - ensure the last word is not left on its own line. Textpattern inserts an invisible code -- a non-breaking space -- between the last two words
- Default: As set in Advanced Preferences.
Examples
Example 1: Display an article title
<h2><txp:title /></h2> <div class="post"> <p><txp:author /> @ <txp:posted /></p> <txp:body /> </div>
- What this does...
- Shows the current article title as the page heading, a few other pieces of information such as the article's author and posted date, then the article body itself.
Other tags used: author, posted, body
Example 2: Display a hyperlinked title
<txp:permlink><txp:title /></txp:permlink>
- What this does...
- Wraps a permanent link to the current article around its title.
Other tags used: permlink




