Error page templates now supported

Hot off the press: Textpattern now supports error page templates.

The upgrade code will automatically create a new page template, error_default. This will be used to display error pages. The new tags <txp:error_status /> and <txp:error_message />, when placed in the template, will include the error code (“404 Not Found”) and message respectively.

If a template matching the error code is found (“error_404”, etc), that will be used as the template. error_default is used when no matching template exists. If error_default is missing, or if the database is unavailable for some reason, a hard-coded page will be used as a last chance fallback.

The code is in the 4.0 development branch, and will be included in the next release (4.0.2).

Comments

  1. Just a note for people thinking about jumping to the dev-branch: The code that lies behind this ist still subject to change. Some things may be dropped, other ideas may be implemented.

  2. Super. It`s perfekt change.

  3. When will 4.0.2 be released?

  4. Ha ha, nice one lads. And Mary’s code too. Can’t be bad. :)

  5. Sweet – I was just wondering when this would get into textpattern two days ago :). Maybe some subconscious reading into the svn commit log, but more likely a clairvoyance.

    And it works great!

  6. That’s great! But I’ve got one question; could you add a conditional like “if error” or something? I use a head form in which the whole head-things are in (like page title, css links etc.) and I’d like the page title to display the error status, for example.

  7. Another one I missed, I should read the blog more often, this project is making huge headway ! Can’t believe how many tags and features are being added this is really cool ! Thx guys !!!

Commenting has expired for this article.