This Textpattern plugin adds a new pane under ‘Extensions’ from which you can export pages, forms, CSS stylesheets, section infos and site variables to a specified templates folder for convenient editing using your preferred code editor. Use it to archive a site’s templates, or as an initial export from an existing site for use with rah_flat or oui_flat.
Paste the .txt or .zip.txt package code into the Admin > Plugins pane, and install and enable the plugin. Visit the “Extensions › Export templates” pane and get ready to export.
By default the plugin looks for a directory called /templates/export
alongside the /textpattern
directory. If the directory does not exist, the plugin will attempt to create it the first time you export your templates. If this should fail, you will need to create the directory manually and assign write permissions using chmod
to 775
(or 777
if your host requires it) before you can proceed. The name you specify for your export will be created as a folder within the /templates/export
folder along with the subfolders. You can then copy the desired folders to your rah_flat
/ oui_flat
templates folder.
Forms are named according to the naming scheme {form-name}.{type}.txp
by default. If you prefer the {type}.{form-name}.txp
naming scheme, set the variable form_naming_scheme
in the plugin source code appropriately:
'form_naming_scheme' => 'type_name'
This is an excerpted and reworked version of mem_templates v0.2 with just export functionality. mem_templates was an adaptation of hcg_templates, which in turn was a modification of mcw_templates (github). This plugin builds on their work.
- Inclusion of
section.json
files - Support for
oui_flat_vars
site variables (if present) asvariable.json
files - Textpack support
- Uses Textpattern’s built-in error notices + Hive styling
- Initial version of stripped down mem_templates
- Code modifications and updates for newer txp versions