Textpattern Sections

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, 12: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.

    The Ethics of Practicing Procedures on the Nearly Dead

    The report from the field was not promising by any stretch, extensive trauma, and perhaps most importantly unknown “downtime” (referencing the period where the patient received no basic care like...

    Read More

  • 260.

    The Ethics of Teaching Hospitals

    I can’t imagine what the patient was thinking. Seeing my trembling hands approaching the lacerations on his face with a sharp needle. I tried to reassure him that I knew what I was doing, but the...

    Read More

  • 260.

    Conscious Conversation: Behavioral Science

    Dr. Eran Zaidel is a professor of Behavioral Neuroscience and faculty member at the Brain Research Institute at UCLA. His work focuses on hemispheric specialization and interhemispheric interaction...

    Read More

  • 260.

    Progress Report

    Two years down, I’m still going. The next two years are my clinical rotations, the actual hands-on training. It’s a scary prospect, responsibilities and such; but it’s equally exciting, after...

    Read More

  • 260.

    Why Medical School Should Be Free

    There’s a lot of really great doctors out there, but unfortunately, there’s also some bad ones. That’s a problem we don’t need to have, and I think it’s caused by some problems with the...

    Read More

  • 260.

    The Cerebellum: a model for learning in the brain

    I know, it’s been a while. Busy is no excuse though, as it is becoming clear that writing for erraticwisdom was an important part of exercising certain parts of my brain that I have neglected...

    Read More

  • 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