Textpattern Notes 6: Overriding Forms

26 May 2005

One of the most frequent questions I get asked about my Textpattern setup is how I do change content per article on the journal homepage. The majority of the time I have excerpts of each article with a link to read the full article, but sometimes I have very short articles that are shown in their entirety, and these just have the link for ‘Permalink’.

Its a feature of TXP that a lot of users I’ve come across don’t use. Next time you’re in your ‘write’ tab, look on the left under ‘advanced options’. That drop down called ‘override form’ will allow you to alter the display of the content per article.

Here’s how I use it:

I have a default article form for displaying posts on the journal front page. This outputs a title, link to full article and the excerpt. Here it is in cut-down form:
<h2><txp:permlink><txp:title /></txp:permlink> <txp:posted /></h2>
   <txp:if_article_list>
      <p><txp:permlink>Read the full entry</txp:permlink>
   <txp:excerpt />
</txp:if_article_list>

(The conditional comments <txp:if_article_list> mean these only show up on the homepage)

I also have another form, which uses similar markup, except that I use the whole body of the article, not just the excerpt. The link text changes to reflect this, so ‘Read full entry’ becomes ‘Permalink’. Here’s the cut-down version of that form:

<h2><txp:permlink><txp:title /></txp:permlink> <txp:posted /></h2>
   <txp:if_article_list>
      <p><txp:permlink>Permalink</txp:permlink>
   <txp:body />
</txp:if_article_list>

Then when I have just a small article to post, I just choose the relevant form from the ‘Overide form’ list. This overrides whatever you’ve set in your page template, not just if you’ve left it to use the ‘default’ article form. This isn’t really stretching its possibilities, and I’d love to know what, if any, ways you use this feature.

Recent Posts

It’s just fashion

26 Jun 2018

The Symbol Sourcebook

08 Jun 2018

Differences between Icon and Logo Design on This is HCD Podcast

10 Apr 2018

Twelve South PencilSnap

01 Apr 2018

The Infinite Canvas

09 Feb 2018

Blade Runner 2049

14 Oct 2017

Instagram Hickstagram

  • 19 Jul 2018

    The human whisperer

  • 14 Jul 2018

    Stopping for a breather - hot day for hills

  • 13 Jul 2018

  • 09 Jul 2018

    Recent garden addition: Stargazer Lillies

  • 07 Jul 2018

    Well… we missed quite a few key acts, but have made it here before Interpol starts at least!

  • 07 Jul 2018

    On our way to BST in Hyde Park. Or… not 😞

  • 06 Jul 2018

    My favourites from this years On Form Sculpture exhibition. The whale was my absolute favourite, but was already sold (which is fine as I don’t have a spare £11,000)

  • 01 Jul 2018

  • 01 Jul 2018

    Not quite in height order. Sort it out

  • 01 Jul 2018

    Filth.

Contact us

Call Jon on +44 (0)7917 391536, email or tweet @hicksdesign.

Alternatively, pop in for tea and cake at the studio…

Hicks
Wenrisc House
Meadow Court
Witney, OX28 6ER
United Kingdom