User Tools

Site Tools


txpun:cms:templates

Templates

Why not a root level templates folder to hold new and archived templates?

Folders

Installing a new template would be as easy as unzipping and uploading a new folder under /templates in your web space, then going into Extensions → Templates and picking from a drop-down list.

All files needed by a template set would reside together

  • /files
  • /images
  • /templates
    • /mistylook
      • /files
        • Scripts - .js, .swf, etc.
      • /forms
        • Presentation → Forms
      • /images
        • Graphics - .jpg, .gif, .png, etc.
      • /pages
        • Presentation → Pages
      • /plugins
        • Admin → Plugins, must be installed individually.
      • /style
        • Presentation → Style
  • /textpattern

Plugin

hcg_templates is a modified version of mcw_templates to work with the /templates folder.

hcg_templates-0.3.txt (26kb)

  • Install via Admin → Plugins.
  • Create the /templates folder on your web space.
  • Make the /templates folder writable by the web server.

Features

  • Import a complete template set - Pages, Forms and Style.
  • Export out your templates for archive purposes or offline editing.

MistyLook

MistyLook is a ported template by TxP-Templates, modified for the /templates folder.

MistyLook 1.1 (62KB)

  • Install via Extensions → Templates.
  • In Presentation → Sections, set Uses page: & Uses style: to mistylook_default.
  • In Presentation → Pages, copy the contents of mistylook_error_default into error_default.
  • In Presentation → Forms, copy the contents of mistylook_search_results into search_results.
  • In Admin → Preferences, set Automatically append comments to articles? to No.

Folder contents

  • /templates
    • /mistylook
      • /forms
        • mistylook_aside.article.html
        • mistylook_comment_form.comment.html
        • mistylook_comments.comment.html
        • mistylook_comments_display.article.html
        • mistylook_content.article.html
        • mistylook_default.article.html
        • mistylook_files.file.html
        • mistylook_footer.misc.html
        • mistylook_head.misc.html
        • mistylook_header.misc.html
        • mistylook_navigation.misc.html
        • mistylook_plainlinks.links.html
        • mistylook_popup_comments.comment.html
        • mistylook_search_results.article.html
        • mistylook_sidebar.misc.html
        • mistylook_single.article.html
        • mistylook_static.article.html
      • /images
        • 404.gif, blockquote.gif, bullet.png, icon_feed.gif, link.gif, misty.jpg, profile.jpg, shadow.gif, shadow_top.gif, sideheadtop.gif, underline1.jpg
      • /pages
        • mistylook_default.html
        • mistylook_error_default.html
      • /plugins
        • hcg_templates-0.3.txt
      • /style
        • mistylook_default.css

Note: This template is included here as proof of concept, Marcus did the heavy lifting and I positioned it into place.

Porting

Once you have your naming scheme and basic structure down, converting an XTML template is a straightforward process. Templates converted from other systems require more time if you lack a working knowledge of said system.

Templates I've already ported to Textpattern, need adjusting to the /templates folder.

One template a week, 52 a year - 10 join in, 520 templates on the web.

TxP IDE

Textpattern Integrated Design Environment, download provided for those wishing to test the template mechanism.

txpide.zip (502KB)

Warning, this shouldn't be run on a production site

    • The latest 4.0.5 SVN code, set the Default Uses page: and Uses style: in Admin → Sections to the template you're working with.
    • The $essential_forms array in /textpattern/include/txp_form.php was changed to protect the forms used as system defaults and un-protect those that weren't.
    • The forms with check boxes beside them in Admin → Forms can be safely deleted, there's a /templates/default backup folder included.
    • The sorting of forms in /textpattern/include/txp_forms.php was changed by removing the order by type asc, it just sorts by form name.
    • A nice TextArea replacement, click Toggle editor underneath the editing areas in the Pages, Forms, Style and Plugins Edit tabs.
    • The code needed to activate EditArea was added to /textpattern/lib/txplib_head.php.
    • Included in the /textpattern/editarea folder, slimmed down a bit.
    • Included in the /templates/mistylook/plugins folder.
    • Included in the /templates/mistylook folder.

Running a local testing or templating environment

  • XAMPP for Windows, XAMPP Lite is all you need to run Textpattern.
  • MAMP for Mac OS X, cause Apple can't set up a LAMP stack?
  • Debian Etch for Linux, help test RC2 of the GUI installer.

Discuss

Any questions, suggestions, whatever, join the discussion at the forum.

Conclusion

TxP IDE is launched…

txpun/cms/templates.txt · Last modified: 2008/12/06 13:55 (external edit)