Sections are the principle content organization mechanism in Textpattern, and the Sections panel is where you manage them.
On this page:
- How do sections apply to Textpattern?
- Creating a section
- List of existing sections
- Editing sections
- Setting the default publishing section
- Searching sections
On this panel you can do two things:
- Create a new section and edit existing sections
- List and manage your existing sections
How do sections apply to Textpattern?
Sections essentially provide the ability to create lateral structure in your site, thus each section has its own unique URL if the site is configured to use clean URLs in the Preferences panel.
In the Sections panel, you’re able to define what Pages and Styles will be used for the Articles published in a given section. You can also control if articles posted in that section will be seen on the front page of the site, and whether or not the articles will be included in site searches and feeds.
In a fresh installation of Textpattern one dedicated section is included: ‘Articles’.
Creating a section
This button will take you to the Section property editor (see below) where you can generate a new section along with its properties.
List of existing sections
Beneath the ‘Create section’ button and search area there is a table containing a list of existing sections. Each row corresponds to one section. If you select the header of a column, it will sort the list according to that column. Select again to reverse sort direction.
Selecting the name of a section will open the Section property editor (see below) that will allow you to set or amend any of its properties. The On front page, Syndicate articles and Searchable properties can be altered directly from the list without having to visit the Section property editor. Simply click the Yes or No links in the corresponding row to toggle its status.
You open the Section property editor when creating a new section or by tapping the name of an existing one to edit it. Each section has various pieces of information associated with it, as described here:
Section name: The name of your section that is used in URLs and as a reference by various Textpattern tags. It must be unique across the site (no two sections can be named the same), and you should try to avoid non-alphanumeric characters besides hyphens and underscores. Further restrictions apply: see Section names to avoid below for a list of unsafe names.
Section title: A title for the section, which can be harnessed by tags (such as section) to display a more human-friendly name for your section.
Uses theme: From Textpattern 4.7.0, pages and styles are grouped into themes. Selecting the theme you wish to use will alter the available pages and styles in the following two select lists.
Uses page: Textpattern assigns its default page template automatically (to ensure baseline publishing capabilities) but you can select differently if you have additional Pages already created. You can reassign sections to pages at any time.
Uses style: Textpattern assigns its default style (CSS) automatically (to ensure baseline publishing capabilities) but you can select differently if you have additional Styles already created. You can reassign sections to styles at any time.
On front page?: This is an extremely important option and should be considered with respect to the overall design of the site. Remember that section content only shows up when that section is viewed, except for the front page. This control permits or denies content from the section showing up when the “front page” (the base
index.php with no arguments) is served.
Syndicate articles?: Textpattern creates RSS and Atom feeds for those who like to run news aggregators. If this is turned on, the feed will display article content from this section.
Searchable?: Textpattern provides an article search function. It may be desirable to segregate some content and not make it available via the search. This control permits or denies the search from finding this content per section.
Description: The section description can be harnessed, for example, as meta data when you display a section article listing page.
Section names to avoid
Sections can be given any arbitrary name, except for a few labels already reserved for Textpattern’s special functions. Avoid the following, or undesirable results will likely occur:
|Section||Reason to avoid|
||Used by Textpattern to serve Atom feed content|
||Used to generate per-author landing pages containing articles from a the given author|
||Used to generate category landing pages containing articles from a the given category|
||Used by Textpattern to serve file downloads|
||Clashes with the default directory used to hold files available for download. If you have moved this via chnages to the Preferences panel then you may use this section name|
||Clashes with the default directory used to serve images|
||Used by Textpattern to serve RSS feed content|
||Used internally by Textpattern|
Section names matching physical directories in your site’s root directory will not work either.
Setting the default publishing section
Here you can select what section you’d like to be the default choice when starting to write a new article. This can be overriden of course in the Write panel per article.
You can use the search function above the section list to locate sections directly by a search phrase or to filter the view by particular criteria, thus reducing the number of rows in the resulting list.
The Search function has two components:
- A text field for entering the search query
- An adjacent drop-down-list to specify which area is to be searched
Anything entered in the text field will be treated as a complete phrase (see the Articles panel documentation for full details on this).
After entering your search criteria you start searching by selecting the search button. As a result you will be given a new list if any rows meet the criteria.
By default, the search will find matches for all fields in a row. You can perform more refined searches by selecting or deselcting areas to search via the drop-down-list in the search tool.
Performing changes on many sections
In the first column you will find a checkbox for each section. Here you can select sections you want to change in a bulk manner. You can mark sections by checking the checkbox or you can use the checkbox in the head bar of the list to mark all sections on that page.
In order to quickly select ranges of sections select the checkbox of the first section you want to mark, press and hold the shift key, then select the checkbox of the last section in the range. All sections between will be checked too. You can add ranges to your selection by repeating these steps.
For performing changes, go to the drop-down list ‘With selected…’ and choose the function you want to perform. After selecting the options you want to perform press ‘Go’ to apply the changes.
At the very bottom of the list you will find a pagination tool. You can change the number of sections listed per page by selecting another value from the number range. If there are more rows available on subsequent pages, you will see the current page number that you can edit and press Enter to jump to that page, along with links to visit the next and previous pages.