Textpattern notes Part 1 is a post on The Hickensian

As and when I get time, I’m going to post some more information about this site’s conversion over to Textpattern. I’m going to evangelise it until I’m blue in the face.

There were quite a few little tweaks I had to make, but here are just a few notes to be getting on with…

Clean URLs for the news feeds

Create your folder structure (such as /feeds/rss/) and place the following code in an index.php file in that last directory:

<?php
header('location: /?rss=1&section=journal');
?>

Just replace ‘rss’ for ‘atom’ if you need that feed too. I’ve also specified that the feed should come from my journal section, but you if you just run Textpattern as a blog you leave this out. Thanks to Drew McLellan of Allinthehead for this one.

Shortstats

In order to get Texpattern and Shaun Inman’s Shortstats working in harmony, I placed the shortstat include at the bottom of each of the section text files in the root. For example, in the ‘article’ file you would have :

<?php
include "./textpattern/config.php";
$s = "article";
include $txpcfg["txpath"]."/publish.php";
textpattern();
include($_SERVER["DOCUMENT_ROOT"]."/shortstat/inc.stats.php")
?>

Mixing hard coded and txp driven pages

In the about section, I needed to do something clever for the ‘about hicksdesign’ page, wheareas the colophon and the contact pages would essentially be just articles.

Using the If_category plug-in by Matthew Moss, I set up the ‘about’ section page to show the hard coded content if the category=hicksdesign, and just a plain article for the others:

<txp:mdm_if_category category="hicksdesign">
....hard coded content in here....
</txp:mdm_if_category>
<txp:mdm_if_category category="colophon,contact">
<txp:article limit="1" form="about" />
</txp:mdm_if_category>

This method is also used to alter the layout between the desktops page and the other downloads pages.

The Hickensian is the journal of Jon Hicks, one half of the creative partnership Hicksdesign. See the work we do.

AD by FUSION

My Zoo

I use Zootool to collect the things I like on the web…

playlist

See more on last.fm

  • Villagers - Becoming A Jackal
  • Arcade Fire - The Suburbs
  • John Grant - Queen Of Denmark
  • School of Seven Bells - Disconnect From Desire
  • The New Pornographers - Together
  • Starflyer 59 - The Changing Of The Guard
  • The Divine Comedy - Bang Goes The Knighthood
  • Beach House - Teen Dream
  • Gorillaz - Plastic Beach
  • Mr B The Gentleman Rhymer - Flattery Not Included
  • Gonjasufi - A Sufi and a Killer
  • Grizzly Bear - Veckatimest
  • Kula Shaker - Pilgrims Progress
  • Matthew Sweet - In Reverse
  • Lemon Jelly - Lost Horizons

Contact

Hicksdesign

Island House

Lower High Street

Burford

Oxfordshire, UK

OX18 4RR

+44 (0)7917 391 536

Download vCard

Hicksmade. Unique handmade products made for machines, not by them