Post
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.
Archive
-
260.
Prodigious Savants and their Abilities
Savant syndrome, a condition occurring most often in autistic patients, is a rare disorder where mentally retarded individuals have incredible abilities in isolated fields like memory, mathematics,...
-
260.
Why Medicine Again?
Medicine isn’t what it used to be. I’ve talked to alot of physicians, researchers and residents recently and I’m not encouraged by what I’ve heard. What seems to motivate many...
-
260.
What of the Soul?
I received a question recently that asked what I thought about the existence of a soul given the relative secularity of most of the content on this site. Soul, Mind, whatever you call it refers...
-
260.
Turtles All the Way Up
That pervasive question, “what are we doing here”, or more accurately, “what’s the fucking point” continues to steal away my attention (and sanity). Looking up is one impetus, but more...
-
260.
Frozen Worlds: a Time Puzzle
I got a bit giddy when we got to the “Space and Time” portion of my Metaphysics class. Most of my semester was spent deciphering bizarre accounts of matter (where two theories’ definitions...
-
260.
Ineffable Understanding
Near-death experiences, hallucinogenic trips, meditation, you’ve probably read about (or felt firsthand) the odd nature of these “out of body” experiences. A philosophically interesting...
-
260.
The Neurobiology of Freedom
So, consciousness is accompanied by an experience of freedom, which phenomenologically speaking, does not seem illusory. But, what exactly does that mean about consciousness and our brain? There are...
-
260.
Natural Kinds in Chemistry
One of my favorite courses so far was last semester’s “Natural Kinds”. Everything from the unique subject matter to the seminar-like structure made the class a blast, up until the...















Comments
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, 02: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