Return to main site

Reporting

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).

---

Comment

  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.

    Also see subversion vs. releases.

    Sencer · Sep 23, 12:01 PM · #

  2. Super. It`s perfekt change.

    Ivo Toman · Sep 23, 12:36 PM · #

  3. When will 4.0.2 be released?

    Maix · Sep 23, 04:30 PM · #

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

    Stuart · Sep 23, 06:08 PM · #

  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!

    Kjell · Sep 23, 06:15 PM · #

  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.

    Julian · Sep 24, 02:17 PM · #

  7. r938 includes two new tags, txp:if_status and txp:page_url

    Alex · Sep 24, 03:00 PM · #

  8. 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 !!!

    David · Oct 3, 02:24 PM · #