Godbit Textpattern Code
10 comments | Posted: 24 January 06 in Tutorials, by Nathan Smith
This article was originally posted on January 24, 2006. However, since it contains a code package that pertains to how this site is run, I am re-posting it. There have been several changes in Textpattern as of version 4.0.4, so the code bundle has been updated accordingly. This is also the code for the Godbit case study in our upcoming book, Textpattern Solutions.
On the flip side of that coin are server-side technologies such as PHP or proprietary CMS code. It is often tough to learn how various people’s projects are done, because by the time the code gets to your browser, it has been transformed into straight XHTML. In this case, we’ll be talking about CMS code, but of course it’s from the open-source project Textpattern. Lucky for our readership, my parents taught me to share, and I want your sites to be nice.
Please note that the basics of how to set up and use Textpattern are beyond the scope of this article. Likewise, I am not going to cover all of the syntax since that is done in the Resources + Wiki. All I’m going to do here is provide you with all of the templates that drive Godbit, and let you sort out the rest. I am presupposing that you know how to at least get Textpattern up and running.
There’s really no effective way to show huge chunks of TXP code in the body of a Textpattern article, because it would be tedious, and TXP would try to convert it to XHTML. So, I’ve done the next best thing and made each page template and form into a text file. Since some of the Forms templates are named the same as the Pages (such as default), I have prefixed the files with either F_ or P_ depending on the type. Also note that intermixed is various plugin syntax, as well as PHP from PunBB. I left it unaltered, just in case it proves useful.
In case you are curious, here are the plugins that are used on this website:
Download Code: TXP_Godbit.zip (12kb) – for v4.0.4
default article form is used for our tutorial code highlighting. Because of a little
txp:if_category conditional, the four JS files can be toggled on/off by simply choosing “code” as the 2nd article category. Hopefully these files will be helpful to you. Happy TXP’ing!
Discuss This Topic
Comments closed after 2 weeks.