Front-end themes

With the arrival of Textpattern CMS 4.7 comes new core theming functionality for the front-end. You may get up to speed with current reading so far with the following resources:

Creating new front-end themes (work in progress)

Creating a theme as flat files

General structure

Themes files must be grouped into a top parent directory named as the theme and should follow the structure above.

Overview
abc_theme
├── manifest.json
├── pages
|   ├── default.txp
|   └── error_default.txp
├── forms
|   ├── article
|   |   ├── article_listing.txp
|   |   ├── default.txp
|   |   └── search_results.txp
|   ├── category
|   |   └── …
|   ├── comment
|   |   ├── comments.txp
|   |   ├── comments_display.txp
|   |   └── comment_form.txp
|   ├── file
|   |   └── files.txp
|   ├── link
|   |   └── plainlinks.txp
|   ├── misc
|   |   └── …
|   └── section
|       └── …
└── styles
    └── default.css

The ‘manifest.json’ file

The manifest.json file contains a theme related data.
The only required field is txp-type which need to be set to textpattern-theme.
The following default value will be used on import for the missing fields or values:

  • title: theme name;
  • version: Unknown;
  • description: none;
  • author: Unknown;
  • author_uri: none;
Example
{
  "title": "Four Point Seven",
  "version": "4.7.0-beta.2",
  "description": "The default theme shipped with Textpattern CMS 4.7.",
  "author": "Team Textpattern",
  "author_uri": "https://github.com/textpattern/textpattern-default-theme"
  "txp-type": "textpattern-theme",
}

The ‘pages’ directory

The pages optional directory should contains Textpattern pages as .txp files.
Two essential pages should be created: default and error_default; they will be created as empty pages on import if missing.
If this directory is missing, empty essential pages will be created on the first import, while on update, pages import will be skipped.

The ‘forms’ directory

The forms optional directory should contains Textpattern forms as .txp files.
While forms should be grouped by types into dedicated subdirectories, they all need to use different names.
Six essential pages should be created:

  • article:
    • article_listing;
    • default;
    • search_results;
  • comment:
    • comments;
    • comments_display;
    • comment_form;
  • file:
    • files;
  • link:
    • plainlinks;

They will be created as empty forms on import if missing.
If this directory is missing, empty essential forms will be created on the first import while on update, stylesheets import will be skipped.

The ‘styles’ directory

The styles optional directory should contains stylesheets as .css files.
A default essential stylesheet should be created; it will be created as an empty stylesheet on import if missing.
If this directory is missing, an empty essential stylesheet (default) will be created on the first import while on update, styles import will be skipped.

Exporting/importing (sharing) front-end themes (Work in progress)

(A forthcoming explanation or links to external community tutorials)

See something wrong in this document? Outdated info, a broken link, faulty code example, or whatever? Please write an issue and we’ll fix it.