Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Packaging/organising a theme
I’m making a Textpattern theme to put on GitHub. Is there such a thing as a preferred or recommended directory and naming structure for the various components of a theme? Like this:
forms/
default.article.form.txt
lorem.misc.form.txt
pages/
default.page.txt
error_default.page.txt
styles/
default.css.txt
README.md
Directories and their contents are sensibly named and nicely arranged. You get the idea.
Understandably, there is a mixture of different structures used in the downloadable themes from Textgarden, hence my question. If there’s interest, may I suggest some discussion as to the best way to structure objects in a theme download, and I’ll write a wiki page so there’s some reference point.
Thinking of PR and awareness, if Textpattern is seen to be more easily customisable from a front-end view, that can only help overall.
Offline
Re: Packaging/organising a theme
If you want to use structure that is compatible with future Textpattern releases that might have themes support, Composer and to otherwise be identical to our core repositories, please use:
forms/
default.article.html
foobar.misc.html
pages/
articles.html
default.html
error_404.html
error_default.html
styles/
default.css
README.textile
This is the structure we use and is also supported by plugins such as rah_flat. Scheme is simply:
/{table}/{item}.{variable-n#}.{extension}
Where:
- {table}: name of the database table without ‘txp_’ or database prefix.
- {item}: primary variable, e.g. template name. Can consist of A-Z, numbers,
_
and-
. Must start with a letter. - {variable-n#}: unlimited number of additional variables (e.g. form type) separated by periods.
- {extension}: The file extension. One of
txp
,txt
,html
orjson
.
Last edited by Gocom (2013-11-21 11:15:08)
Offline
Re: Packaging/organising a theme
Perfect. Thanks, Jukka.
Offline
Re: Packaging/organising a theme
For reference and completeness, I opened this GitHub issue last night: github.com/textpattern/textpattern-default-theme/issues/47
Offline
Pages: 1