Table of Contents

Semantics

One of the goals of a tool like Textpattern is to separate the content (like blog posts or articles) from the presentation (the way these items get formatted for the user). This makes it easier to display the content with different styles or for different devices, like mobile phone users. Textpattern does an excellent job at this separation and this guide will give you a behind the scenes look at how the elements fit together to accomplish this feat.

Note: On a smaller scale, Textpattern uses Textile to separate text from formatting in a way that you don't normally get with other markup languages. For example using asterisks to *emphasis* text is better than putting <b> tags around words, since the concept of bold implies a visual device. Emphasis works for all users, including those that are using screen readers to “speak” a page out loud.

Textpattern Terms

In the following sections we briefly present the main components of Textpattern (Sections, Pages, Forms, et cetera). Each of these will be discussed in more detail throughout TextBook, particularly in the Administration pages, but it will be helpful to get acquainted early on.

Sections

A Textpattern Section is similar to sections in a newspaper, these form the basic navigation of a website. For example, the “entertainment” section might be accessed by the URL in your browser: “www.localhost.com/entertainment”. Each article belongs to one - and only one - Section, this is where the article will be found on a website.

I think trying to explain the "default" and "article" sections are confusing. To be honest, I'd change their names in Textpattern to make it more clear. I'm also not talking about the homepage being a separate, built-in section.

Pages

In Textpattern, a Page provides the overall XHTML layout for a section of a site. Looking at our newspaper example, these would have the title, header, footer and other information that's the same on all pages. Textpattern starts with these templates and then uses forms to connect with Articles and other content.

I don't want to introduce the concept of Form versus Page tags.

Forms

A Form is a discreet, reusable chunk of content, which can contain text, XHTML markup, and textpattern codes. Different Forms might take the same Article and display different fields, like listing the article titles as links on an archives page and then excerpt/body information on a detailed page.

Style

A section references a Style, which contains CSS information about fonts, element positioning, etc. Like Pages, Styles are tied to Sections so each section of a site can have a different look and feel.

Article

Most generically, an Article is a globally unique block of content. Textpattern attaches properties to these blocks, such as titles, authors, timestamps, categories, etc.

Categories

A Category is a method of organizing articles by the nature of their content - not by their location in the navigation structure. If you cut articles out of the newspaper and put them in envelopes, you'd be matching the effect of categories. You may have an envelope for Britney Spears that had an article from the “entertainment” section and maybe an article from the “birth announcement” section.

The Britney Spears Category is nothing but a label that was put on Articles to make it easier to search and display information. Categories are not intended to be used as navigational elements.

Seems weird to talk about categories at this level. The rest are tabs on the UI and are more integral to Textpattern. I only go into detail here because the concept is often confused.

How do keywords fit into this?

How things Fit Together

If you have Textpattern installed, log onto the admin area and you'll see the four main tabs that are available - presentation, content, admin, and view site. The admin tab is for configuring the Textpattern install and is discussed in Administration. If you click on the view site tab, a new browser window will be opened and you will see the default front page of your new site. What you will seeing is the default “section” of your site.


Figure 1: Presentation View - section display is determined by page templates and article forms with help from stylesheet information.”

1. Page Template

you can click the “sections” tab in the admin interface to see more on how this is configured. Textpattern displays this section unless another is specified, for example if you go to a Textpattern website with the URL www.localhost.com/cheese, you're telling Textpattern to load the “cheese” section. The front page does not have its own articles; it simply displays articles from all the sections that have the “display on front page” option set to “yes.”

The section configuration itself contains little information besides what page and what style to use. That's all Textpattern needs in order to load the page template and start the process of rendering the file for the user. Clicking the “pages tab” will let you see the template, which is essentially an XHTML document.

2. Article Forms

Inside this document are Textpattern tags that tell further details on how to format the data. The page template has the overall structure and textpattern will load any forms that are referenced. These forms are used to format the articles that are assigned to his section.

I don't mention that Forms can also reference other Forms.

3. Stylesheet Information

Related Reading

Please add references below to other online articles that discuss Textpattern Semantics.