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.
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...
-
260.
The Phenomen- ology of Freedom
Are we truly free? Are the paths of our lives charted beforehand, or is every moment an opportunity to break new ground? The answer isn’t easily found, the determinate physical world seems to hit a...
-
260.
An Open Letter to God.
So here’s the deal, we’ve been here a while doing great things and…eh things, but there’s always been that trickling or gushing concern about why. We’re amazing, when you stop to think...
-
260.
Nietzsche: The Fast Track
The darkly dressed student made yet another existentially pessimistic remark and the professor unleashed one of the harsher insults I’ve heard: “Every student goes: Nietzsche, Schopenhauer,...
-
260.
Computers and God
I came across an interesting presentation on digg (and surprisingly, it wasn’t a kitten with horrifying spelling/grammar) recently that compared – albeit often fallaciously – our...
-
260.
Surviving Life
The questions we ask are not ones we can ponder in our free time and easily set aside when there’s life to do. What am I? Am I free? What is the purpose of my existence? Why should I strive to...
-
260.
The New Erratic Wisdom
Another semester, another redesign (give it a solid refresh to clear your cache). This one’s been brewing for quite some time now, with the notched grid motif coming around a few months ago,...
-
260.
Imperfect Art
Plato’s metaphysics and his Doctrine of Forms describes a general division of our universe into forms and particulars. Forms are instantiated by contingent particulars. That is, particulars are...















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, 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