Textpattern CMS includes support for Textile, a markup language for formatting content. In this how-to, I’m going to explain how to translate the various HTML components involved with generating lists and notes, including:
- bulleted lists
- numbered lists
- definition lists
Clearly some of these items will be of more use to you than others, depending on how you deploy and use Textpattern on Arvixe. Bulleted and numbered lists are widely-used across the web on many different types of website, and they are also the most straightforwart to accomplish in Textile. A bulleted list is similar to the list above – bullets, not numbers, are used to indicate a list of things. Typically this is achieved in HTML with the `<ul>` and `<li>` tags, like so:
<ul> <li>First item <li>Second item <li>Third item </ul>
This is a single-level list. It’s possible to have a multi-level list, essentially a list inside a list, like this:
<ul> <li>First item, first level <ul> <li>Second item, second level</li> <li>Third item, second level</li> </ul> </li> <li>Fourth item, first level</li> <li>Fifth item, first level</li> </ul>
Textile makes either or both options really easy. Here’s how to build an bulleted (unordered) list in Textile: asterisks.
* First item, first level ** Second item, second level ** Third item, second level * Fourth item, first level * Fifth item, first level
Essentially, each asterisk represents the level of list. If you want a single-level list, just use one asterisk per line of text and Textile takes care of it. Two levels? Two asterisks. Three levels needs three asterisks.
Numbered lists are typically built in HTML with the `<ol>` and `<li>` tags. Same structure as the unordered lists, but this time they’re ordered lists – hence the `<ol>` reference. Rather than using an asterisk to create the lists, a hash (pound) symbol is used by Textile to build ordered lists, so just re-read the above comments about unordered lists and substitute a hash. Done.
Definition lists are not as widespread as ordered or unordered lists, but are still useful in many situations. Take the following HTML example:
<dl> <dt>Banana</dt> <dd>A yellow fruit.</dd> <dt>Cherry</dt> <dd>A red fruit.</dd> <dt>Damson</dt> <dd>A purple fruit.</dd> </dl>
The Textile for definition lists is a hyphen, a space, then the item identifier, then another space, then a colon, then an equals, another space, and then the description and a line break to end the list item. Like this:
- Banana := A yellow fruit. - Cherry := A red fruit. - Damson := A purple fruit.
If you end up writing more about fruit and its various colours, and I think you should, then footnotes might come in useful. A footnote is essentially a reference that’s typically at the end of an article or page. On the web, it’s expected that footnote links should be clickable, and Textile can do that for you. First, here’s the HTML:
<p>I really like to eat bananas<sup class="footnote" id="1"><a href="#fn1">1</a></sup>.</p> <p class="footnote" id="fn1"><sup>1</sup> Bananas are very tasty and nutritious.</p>
That’s a little unwieldy in HTML. Textile is a somewhat cleaner:
I really like to eat bananas. fn1. Bananas are very tasty and nutritious.
The key to understanding whether a) Textile is a good fit for you and b) Textpattern is the right choice is to use both. Don’t overthink it, deploy a Textpattern on Arvixe and try it out. If you already have a hosting account it’s trivial to install Textpattern with Softaculous.