Admin-side themes
You may now alter the look and feel of the admin side and ‘skin’ it to you or your clients’ tastes without having to resort to core hacks. This gives your clients a much more personal experience when using Textpattern.
An admin-side theme is a self-contained folder in the new core theme directory. It can be made up of CSS, images, Javascript/jQuery, and even PHP code if you wish to take advantage of the ability to programmatically alter the admin side.
There are plenty of themes to download and try. Simply unzip the package and upload the folder to your theme directory. Choose a theme from the select list on the ‘Advanced preferences’ panel to apply it site-wide for all your authors to enjoy.
Of course you can tweak those or make your own. There is more detail on creating themes at the user documentation site. If you wish to create and share themes in a more graphical manner, you may install the smd_admin_themes plugin which was developed side by side with the new theme engine to help you manage themes for your authors.
Multi-site support
Out of the box, Textpattern CMS can now be installed once and configured to host any number of websites from that same installation. This may help ease your upgrade workload as you can apply the new version once in order to simultaneously update all sites. Each site continues to have its own database.
Besides the ability to host multiple sites, there are other benefits of a multi-site installation. It is possible to improve Textpattern’s security (as if it wasn’t high enough already!) by moving the admin files out of the standard web root directory and/or protect the admin area with SSL.
There is a detailed README.txt
file in the sites
directory of your Textpattern install that shows how to set up for multi-site operation.
Enhanced role-based permissions
Textpattern has long since had article permissions so you can permit authors to only modify their own articles. From 4.2.0 onward, this is extended to images, files and links too for additional protection against accidental deletion of key items.
This feature brings about the concept of ‘ownership’ of a set of resources — something we’ll be capitalising on more in future — and thus adds one extra step during the deletion process. When removing any author, all resources that person ‘owned’ must be reassigned to another existing author. You will notice this when you try to delete one or more users from the Users panel; a select list of authors appears for you to choose the new owner.
Toggle states remembered
In prior Textpattern versions, each visit to one of the various admin tabs reset its view to a default. In 4.2.0 each user can have their own preference settings. This applies to plugins as well so the admin side experience can become more customisable and personalised from now on.
One of the benefits of per-user preferences is that Textpattern now remembers key state information in each panel; the sort order you have chosen, and whether you have opened or closed the ‘twisties’ such as the More or Advanced segments of the Write panel.
Previously, a plugin was required for this (the most popular being rss_admin_show_adv_opts
). This plugin had a good innings but is now retired and should be removed from your installations in order for Textpattern to function correctly. Other plugins may also try to alter the state of the toggle panes (for example glz_custom_fields
and sed_section_fields
) so if your pane states are not being memorised, check whether these plugins are activated.
Plugin authors in for a treat
If you’re a plugin developer, the Textpattern platform continues to grow to help you write more efficient, leaner and powerful code:
- Larger plugins — up to 16Mb — means you have even greater scope
- Plugins may now react to installation, activation, deactivation, and deletion events, so you can automatically install or remove tables/preferences, for example
- Plugins can optionally offer a link to their plugin prefs directly from the Plugins panel
- A slew of new callbacks make up the pluggable UI system. These allow you to alter, extend or replace admin-side widgets with greater ease than ever before. And other callbacks have been introduced to enable you to hook into a large number of places during the execution of both the public and admin sides
- Better AJAX support through the use of the app_mode URL parameter. Adding
app_mode=async
to any admin-side event will not output any default admin side markup, allowing you to write your own AJAX-style callbacks in your plugins. The newsendAsyncEvent()
javascript function packages this up for you so all you need to supply is the data name-val pairs and an optional callback function to execute when the request has completed
Time handling
Textpattern’s time zone and DST handling has been given a make-over if you have a recent version of PHP (5.2+). DST can now be automatically detected and applied, saving you the hassle of remembering. Time handling has also been made more robust with respect to time zone calculations.
And some more tags
<txp:link_id />
allows you to output a link’s ID, which is incredibly handy for sorting or as a tag-in-tag.
The other change is to allow <txp:output form>
to be a container tag and permit parameterized output via the new <txp:yield />
tag. With this feature you can reuse a form and pass different information into it each time it is called. The contents of the <txp:output_form>
container is plugged into the given form wherever the yield tag is placed.
Here’s an example for building a crumbtrail. In your form ‘crumbline’:
<ul id="crumbtrail">
<li><a href="/" rel="home">Home</a></li>
<txp:yield />
</ul>
Then in each Page template you can construct the elements that are added to the end of the crumbtrail and display them using the same form.
So, on a ‘competitions’ page:
<txp:output_form form="crumbline">
<txp:if_article_list>
<li class="last">Competitions</li>
<txp:else />
<li><a href="/competitions">Competitions</a></li>
<li class="last"><txp:title /></li>
</txp:if_article_list>
</txp:output_form>
The possibilities are immense for reuse and simplification of your Page/Form template interactions.
That’s all folks!
We hope you enjoy this release and the new features enable you to continue creating the dynamic, cutting edge sites that make Textpattern the best choice CMS for site designers.