TEXTPATTERNSECTIONS

Part 3: Textpattern Sections

Textpattern Sections are by far the most misused aspect of Textpattern and I am often guilty of employing them when they are entirely unnecessary. Textpattern sections are strong content and presentation dividers and are powerful enough to create different blogs or websites from the same installation.

Separate sections should only be used if you are trying to:

  • Create “static” pages – Tutorial
  • Create different “blogs” with entirely different layouts and styles
  • Manage archives

Sections should not be used solely for content division; there are categories for that purpose as well as other external tagging services.

Creating a section is a simple process (Presentation > Sections > Create), but it is the features of each section that is important. Under each section are eight items (In version 4.0.2 anyway, I believe there were six in earlier versions?). These items will dictate how your section will function. Let’s go through each:

Section name: This is used mainly to determine the URL if you have chosen (and are able) to have “clean” permalinks. You will refer to these names in any tags (i.e. <txp:if_section name="about,archive">).

Section title: This is the title of the section that is displayed by the <txp:page_title />. This is usually the same as the section name except with a capitalized first letter for appearance.

Uses page: This is one of the more important section properties because it allows for a completely different structure depending on the section. In a typical installation, you should have three page templates:

  • default: used for the Home Page
  • archive: used for individual articles (can be combined with default)
  • static: for “static” pages (also not required)

I don’t want to go too in-depth because I have a separate article for page templates, but the beauty of Textpattern is clearly visible here. It is such a simple and elegant system that you can run a full website with only a couple templates and a handful of forms.

Uses style: This has a similar function as the “Uses page” and allows the user to apply different styles to different sections. For example, you can manually insert the base style into the header and then include an “open” <txp:css /> that perhaps applies a particular color scheme to each section.

Selected by default: This is more of a convenience than a feature; it is used to select which section is the default when writing a new article.

On front page: This feature determines whether or not articles posted to the section appear on the front page. Sections that do appear on the front page are then picked up by the “default” section which is the front page of your website. You can not post directly to the “default” section, but articles you want to appear on the front page should be posted to a section with this feature on.

Syndicate: This one is fairly self-explanatory: if yes, articles in the section will appear in the main feed. Generally “static” sections should not be syndicated because the articles they contain will usually be “About” or “Contact” articles.

Include in site search: Again, self-explanatory. I haven’t come across any instances where sections should not be searchable, but if you ever need it…it’s here.

A quick tip to remember when modifying any of these settings is that you must save each section’s changes individually (using its own “save” button). I’ve wasted a lot of time trying to figure out what I was doing wrong when it turned out that I was always pressing the save button at the bottom of the page.

Some important tags are:

The <txp:if_section> tag is obviously quite powerful and is processed correctly almost everywhere. Some places I use the tag is in my pages’ <title> tags so that static sections only output a more detailed title (also involves the ob1_title plugin). Another example use is in advertisement tracking. I have a number of conditional tags that output a specific channel ID depending on the section.

That is a quick overview of sections and what you can do with them. Again, if I neglected to mention or discuss something please leave a comment and I’ll add it in. Also, I must apologize in advance if I’m late with the next article. The hectic Final’s Week is about to begin in my first semester of college and I really must focus on my studying…you wouldn’t want me to do badly now would you?

Go ahead and grab my feed so you know when the next article is ready.

  1. Hello,

    I hope I am not too late to congratulate you on this piece of writing. I have been struggling with Textpattern for a month and your text helps me more than that of others. Thanks for taking the time.

    You have at least eight more friends than I do. I grew up on the East Coast but live about 6000 km. farer east of you now.

    Good luck with finals.

    I have to get back to reading more of your manual.

    Verne

    Oliver

    Dec 21, 03:19 AM #

Add a Comment

Phrase modifiers:

_emphasis_
*strong*
__italic__
**bold**
??citation??
-deleted text-
@code@

Block modifiers:

bq. Blockquote
p. Paragraph

Links:

"linktext":http://example.com


Show Articles By:

You can show articles by time or category.

  • 260.

    Conscious Conversation: Philosophy

    Daniel Black, author of Erectlocution, was kind enough to chat with me one day and we had a great discussion – have a listen.

    Read More

  • 260.

    The Stuff in Between

    I’m actually almost normal when not agonizing over robot production details, and quite a bit has happened since I last wrote an update. First, I’ve finally graduated. I had a bit of a...

    Read More

  • 260.

    The Ethics of AI: Part Three

    Is it ethical (or possible) to constrain intelligent life? This part of the argument involves what we think it means to be human, and whether creating and adjusting those criteria in an AI affects...

    Read More

  • 260.

    The Ethics of AI: Part Two

    Is it ethical to allow humanity to continue, or to replace our species with machines? This is getting tougher. Why does humanity deserve to exist? The recorded history of the experiences of Homo...

    Read More

  • 260.

    The Ethics of AI: Part One

    Is it ethical to create consciousness? In this discussion, I will make the assumption that we can be assured these beings are “personally” intelligent (i.e. just like us). As we see in nature,...

    Read More

  • 260.

    The Ethics of Artificial Intelligence

    I am beginning a series exploring some ethical concerns associated with the development of artificial intelligence. Neurobiological evidence points firmly to the brain as the source of human...

    Read More

  • 260.

    The Atheist's Purpose

    As a lot of the content on this site suggests, I’m an atheist. Being an atheist can be a bit contentious, as many find the lack of an explicit purpose or codified moral laws wrong. So, I’d like...

    Read More

  • 260.

    Conscious Conversation: Computation

    Dr. Rapaport is an associate professor in the Department of Computer Science and Engineering at the University at Buffalo with research interests in Computer Science, Artificial Intelligence,...

    Read More