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

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

iPad Pro Pencil loop

11 Oct 2017

Troika #32: Tearjerker

04 Oct 2017

Instagram Hickstagram

  • 23 Apr 2018

    Your birthday pavlova awaits you @hicksleigh!

  • 23 Apr 2018

    A very Happy Birthday to my lovely wife Leigh! We’re keeping the age a secret a though…

  • 18 Apr 2018

    Kind of them to notice!

  • 18 Apr 2018

    A very Happy 20th Anniversary to @hicksleigh! I love you more than ever wifey, and still thank my lucky stars that we met. 😘😍

  • 16 Apr 2018

    If anyone’s interested in buying a nice carbon road bike, I’m selling my Colnago 😉 https://www.ebay.co.uk/itm/Colnago-CLX-3-0-2012-carbon-road-bike-size-54/302705911235

  • 15 Apr 2018

    So pretty!

  • 13 Apr 2018

    Tasty one this

  • 10 Apr 2018

    Replacing worn out MacBook keys. I obviously type ‘a’ a lot

  • 08 Apr 2018

    Grown up Fanta

  • 07 Apr 2018

    Reader, I dropped it. #pintofhead

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