Textile lists and notes in Textpattern CMS


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
  • footnotes

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:

<li>First item
<li>Second item
<li>Third item

This is a single-level list. It’s possible to have a multi-level list, essentially a list inside a list, like this:

<li>First item, first level
<li>Second item, second level</li>
<li>Third item, second level</li>
<li>Fourth item, first level</li>
<li>Fifth item, first level</li>

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:

<dd>A yellow fruit.</dd>
<dd>A red fruit.</dd>
<dd>A purple fruit.</dd>

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[1].

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.

Looking for quality Textpattern Hosting? Look no further than Arvixe Web Hosting and use coupon TEXTPATTERN for 20% off your first invoice!

Tags: , , , , , , , , , , | Posted under Textpattern | RSS 2.0

Author Spotlight

Pete Cooper

Pete Cooper has been using Textpattern since 2005. Textpattern is his preferred CMS weapon of choice. Its logical and flexible approach to content management makes Pete happy, as does its lightweight core and helpful user community. Pete's website - petecooper.org - runs on top of Textpattern and chronicles his day-to-day experiences from his home near the Atlantic in north Cornwall, United Kingdom.

Leave a Reply

Your email address will not be published. Required fields are marked *