Getting to Know the Textpattern Presentation Tab

In my last post I introduced you to some of the specifics of the Textpattern CMS administration interface on the Content tab. Today it’s the turn of the Presentation tab. The Presentation tab is accessed via the administration interface and it controls various aspects of how your site looks and feels, including:

  • How articles are filed
  • (X)HTML
  • CSS
  • Reusable text blocks

Open your Textpattern administration panel and click the Presentation tab across the top. Depending on what administration-side settings you have (I’m using English as my interface language and the Classic theme yours may differ), it will look something like this:

Note the names of the sub-tabs:

  • Sections
  • Pages
  • Forms
  • Styles

Sections are Textpattern’s way of filing an article in a given area of your site. Examples of section names include: blog, about, contact, articles, whitepapers, and so on. Usually, a section is best used in conjunction with a memorable or straightforward URL format, like this:

http://example.com/blog

An article filed in the blog section might have a title of “Lorem Ipsum”, so ultimately the URL could be:

http://example.com/blog/lorem-ipsum

Think of a section as a drawer in a multi-drawer filing cabinet. You can switch an article from one section to another, but an article can only be in one drawer. You can duplicate an article and have it in more than one drawer, but what was once a single article is now regarded as two articles by Textpattern, each recognised by its unique numeric identifier.

There is a section on each Textpattern install called ‘default’. This refers to the homepage or root of the site. You cannot delete, rename or do much to this section. It is also important to note that you cannot assign an article to the default section.

Each section has a title and a name. The title is what’s used in the URL, and the name can be something more human-readable or prettier-looking. Each section is assigned a page (HTML page layout) and a style (CSS), and I’ll cover each of these later in this article. Additionally, each section has a bunch of yes/no toggles to define whether the articles from that section:

Appear on the front page
Are syndicated with the built-in RSS/ATOM feeds
Are included in a site search

The section editor looks like this:

Clicking on a section name will bring up specifics for that section:

Let’s cover the Pages sub-tab:

The Pages sub-tab is related to the Sections sub-tab. Each section has a page assigned to it, and a page is essentially the markup for articles in that section. Usually, this is (X)HTML. Textpattern will readily accept and manage multiple pages, but a section can only have one page assigned to it. You can use this to your advantage if you want your site to have a different look and feel for each section. You may, for example, have a different layout for a list of outgoing links compared to the rest of your site, or your homepage may be a landing page with a totally unique look. Regardless, you can construct as few or as many pages as you like.

Pages are stored in a text box inside the Pages sub-tab. They can be constructed offline and pasted in. I prefer doing this to editing directly in the browser, especially since I can save backups and have some control over versioning. Pages that have no sections assigned can be deleted. If they are being used by one of more sections, they cannot be deleted. There are two pages that cannot be deleted: default and error_default. If a page is rendered with a 400-class HTTP error (404, for example), the error page is parsed. If the page is rendered with a non-400-class error (say, a successful 200) the section-assigned page is parsed.

Now, onto the Forms sub-tab:

Forms are a sometimes tricky to understand if you’re a Textpattern newcomer. If you have some experience of partials from another CMS then this should be pretty straightforward to grasp. Forms are essentially reusable chunks of text. Whereas a page is rendered once per browser view, a form may be repeatedly processed. This is normal, and expected.

Each form has a type and there are five types of forms:

  • Article
  • Miscellaneous
  • Comment
  • File
  • Link

Article, comment, file and link forms are very similar: they are used to display various components of an article, comment, file or link from Textpattern. An article form might include tags for displaying the article title, body and author in a particular way. A comment form might extract the time of a comment, the comment author and a link to their website. A file form might display the download count for a specific file and a link form may construct a hyperlink to another site.

In most of these cases, lists of the articles/comments/files/links may be needed, so the form cycles through as many time as is needed to build the list of whatever was requested. Connecting this with the section and page concepts, think of it this way: each section has a page, each page has forms which populate its content, be it articles, files, links or comments. Miscellaneous forms are a bit different and are not tied to any content type. Miscellaneous forms are called from pages, as per the other form types, but are simply text. This might be code, copyright information or simple text.

Finally for today, the Styles sub-tab:

A section, as previously mentioned, as a page applied to it. It also has a style. This tells Textpattern what CSS to apply to a section. Like the Pages sub-tab, the Styles sub-tab provides a rudimentary editor for you to use. You can edit offline if you wish, pasting the CSS into the editor box and saving accordingly. A style associated with a section can be easily updated: just jump back to the Sections sub-tab, select your section, choose the style from the drop down and save.

I have another confession: I don’t use the CSS tab, personally. My CSS typically resides outside of the Textpattern interface and I edit it manually. I do this for version control and other technical reasons, but the important thing is I stopped using the Styles tab after some years when I found a solution that was more suited to me. You may have spotted that a section must have a page and style assigned to it, and that if I’m using external stylesheets that might cause a conflict. You would be right. My solution was to create an empty style called ‘placeholder’, assigning that to my pages and editing my page to point to the external stylesheet.

Thanks for reading about the Presentation tab in Textpattern CMS. Next time, I’ll be showing you around the Admin tab. I hope you’ll be able to join me.

Looking for quality Textpattern Hosting? Look no further than Arvixe Web Hosting!

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

Author Spotlight

Pete Cooper

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 *


− 4 = 3

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>