Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-11-21 10:47:42

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,271
GitHub

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

#2 2013-11-21 11:13:58

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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 or json.

Last edited by Gocom (2013-11-21 11:15:08)

Offline

#3 2013-11-21 11:15:35

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,271
GitHub

Re: Packaging/organising a theme

Perfect. Thanks, Jukka.

Offline

#4 2014-05-09 10:15:11

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,271
GitHub

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

Board footer

Powered by FluxBB