Textpattern CMS Plugins: Introducing rah_section_titles

admin-ajax

Textpattern CMS can be extended using plugins. This concept of extending the core product with add-ons is common with many content management systems, though the method of extending Textpattern differs from the file-based approach of most other systems. In Textpattern, plugins are uploaded as encoded text via the administration interface. If there are additional files required for the plugin to be used, they are invariably uploaded using FTP in the traditional sense, but extensions that don’t require any files are means the administrator doesn’t have to venture outside the administration interface.

Plugins can range from simple option toggles that affect the administration interface to full-on, multiple file approaches that dramatically change the functionality of a website. To start you off in your Textpattern plugin journey, I’m going to showcase 5 widely-used and well-respected plugins. All the plugins were written by Textpattern core developers. This is intentional, and highlights a belief that Textpattern should not be all things to all people; the core product is nimble and flexible, but is never bloated by unnecessary functionality that a small subset of people would use. The core development team of Robert Wetzlmyer, Stef Dawson and Jukka Svahn all contribute code to and develop the core Textpattern product, and have written additional plugins that an administrator can choose to install if they wish.

Jukka’s rah_section_titles is one of the more straightforward plugins. It’s a code-only plugin, so it won’t need any files to be uploaded. The purpose of rah_section_titles is to switch the Write tab section dropdown menu from the section name to the section title. To remind you, a Textpattern section has a name and a title. The title is, generally, the more verbose of the two. In this example, I have two sections in Textpattern: articles and about. Both of those are the section names, with the respective titles being ‘Articles about my cat’ and ‘About my pets’. You can view and edit section names and titles from the Presentation → Sections tab:

Google ChromeScreenSnapz001

Note the names and titles. Switch to the Write tab (Content → Write) and you’ll see the right column assigns the article to a Section, listing its name – in this example, the name is `articles`. The plugin will switch that `articles` reference to `Articles about my cat`. The plugin is downloaded from Jukka’s site – use click the link above and then choose Download – and the Textpattern-ready code looks like this (trimmed for brevity):

# Name: rah_section_titles v0.7
# Write panel's section list displays titles instead of names
# Author: Jukka Svahn
# URL: http://rahforum.biz
# Recommended load order: 5
# .....................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the "Install plugin" box:
# .....................................................................
H4sIAAAAAAAAA5VXe1MbNxD/G3+KjZsZGwbuzsZguBDihKR5TJLSmL6GUI98J/sU7k5XSWfH
TfPduysJY4PpTGd4WKt97+q3axZ3evE3HffiZskK3nyi485R3FQsG2meGCHLkREm55pu+nFz
xpVGIp3242YU9OnTYdxktcmksuKduPmuvr5mMJyxzHJ2ohuGUa2EpRzHzcyYKg5DNDWRqi6C
[...]
UkG5wa2d49qOjKKolJxh/zg83oEP9nSnyTBtg5MMU3w6+E9cwQZCrHqwhTo+pYhi0XEY9Sil
z9N0BVMGJ2MFIVm5K7oU7IedLgm+LYUR+NVD4V7HNA/8l8sitZvWfhe/Dx4fHqa9cSdlvNuf
JGO2H/WjXsJ6KT86ODxGvu//Am/oGJPJDgAA

As the comments in the code indicate, the plugin is installed using the Admin → Plugins tab. Highlight the text that appears after the Download link is clicked or tapped and copy it to your clipboard. Switch to the Admin → Plugins tab in Textpattern and paste the code into the box:

Google ChromeScreenSnapz004

Click Upload. You’ll see a preview of the PHP code and any associated help text and be asked to confirm:

Google ChromeScreenSnapz005

Click Confirm and the plugin will be uploaded. You will be taken back to the Plugin tab:

Google ChromeScreenSnapz006

Note the new plugin is installed but disabled. This is intentional. To enable the plugin, click or tap No under Active and it switches to Yes to indicate activation:

Google ChromeScreenSnapz007

That’s it. To see the fruits of your labor, switch to Content → Write and note the changes in the right column. You will now see the section title listed in place of the section name:

Google ChromeScreenSnapz008

Looking for quality Textpattern Hosting? Look no further than Arvixe Web Hosting and use coupon TEXTPATTERN for 20% off your first invoice!

Tags: , , , , , , , , , , , , , , , , , | Posted under Textpattern | RSS 2.0

Author Spotlight

Pete Cooper

Pete Cooper has been using Textpattern since 2005. Textpattern is his preferred CMS weapon of choice. Its logical and flexible approach to content management makes Pete happy, as does its lightweight core and helpful user community. Pete's website - petecooper.org - runs on top of Textpattern and chronicles his day-to-day experiences from his home near the Atlantic in north Cornwall, United Kingdom.

Leave a Reply

Your email address will not be published. Required fields are marked *