kff_txp_version

Posted: 9 September 2009
Textpattern is widely known for its plugin architecture, which can provide any extra functionality, if needed. Yesterday, I decided to write my own plugin.

Preface

I've been using Textpattern for over 3 months now, and I couldn't be happier. Yet the thought of giving something back to the community was always lingering in my mind. I wanted to create something the community could use, like a TXP theme or plugin. I don't have much free time these days, so a theme was crossed out. So a plugin it was.

 

Now, I'm not exactly a PHP wizard (yet), so for my very first plugin, I decided to make something extremely simple and clean. After searching the TXP Resources site for something that had not been done before but still simple enough to be a "first plugin", I found it: a TXP tag that displays the version number of the Textpattern engine installed.

 

I don't know whether this is going to be useful, or how many users will even download it; but that was not the point. It was a learning experiment. Whether it will be the first of many such plugins, I cannot say right now. So here it is. Ladies and gentlemen, mesonprojekt presents kff_txp_version. Thank you very much.

 

Documentation

kff_txp_version is an extremely simple and tiny plugin displays the version number of Textpattern running on your site. It outputs plaintext which can be linkified if desired. Use, for example, within your site footer in a “Powered by Textpattern” message.

 

Installation / Uninstallation

Download the plugin as a text file from the link below, paste the code into the TXP Admin->Plugins pane, install and enable the plugin.

Uninstall by simply deleting the plugin from the Admin->Plugins pane.

 

Syntax & Attributes

The plugin creates a new tag <txp:kff_txp_version />, which has the following attributes:

 

link="boolean"

Whether or not to make the word "Textpattern" link to the TXP website.

Values: 1 (yes) or 0 (no)

Default: 1

 

wraptag="tag"

(X)HTML tag (without brackets) to wrap around output.

Default: unset

 

class="class_name"

(X)HTML class attribute to be applied to wraptag. Used for styling purpose.

Default: unset

 

Usage

Default tag

The default tag <txp:kff_txp_version /> without attributes produces the linkified output:

<a href="http://textpattern.com/">Textpattern</a> 4.2.0

 

Plaintext output

The tag <txp:kff_txp_version link="0" /> produces plaintext output:

Textpattern 4.2.0

 

Download

You can download the plugin here: txp:kff_txp_version

 

License

This plugin is released under the GNU General Public License.

 

Resources

For more info and updates about kff_txp_version, also see the official page at the Textpattern resources site.

 

 

Comments

There are 4 comments for this article. Comments are now closed.

Giuseppe Caruso said:
13 September 2009
18:02

Hi Karl, thanks a lot, really useful in its simplicity.
I will surely use it.
But, hey… you must upgrade your Txp installation, 4.2 is out! ;)

p.s.
The more I look at your website the more I like it. :)

Karl Francisco Fernandes said:
14 September 2009
01:52

Thanks Giuseppe! Yeah, I intend to upgrade soon, I’m just trying out 4.2.0 on my local server for the time being.

Oleg said:
30 September 2009
23:29

Nice posts there – thank’s for the interesting information.

Karl Francisco Fernandes said:
01 October 2009
19:59

Thank you Oleg!