Create, edit and delete scripts in Textpattern admin and export on save to external files.
REQUIRES: Texpattern 4.4.1 and PHP 5.
Please read the instructions and notes below before use.
Features include exporting scripts as files to a directory, optional “type” attribute
name= to bring it in line with default css syntax.
Re-written for Textpattern 4.4.1 to mimic the Presentation > Style tab.
- Activate this plugin.
By default the plugin outputs a script tag without the ""type" attribute":http://www.w3schools.com/html5/tag_script.asp (required in XHTML/HTML4 but optional in HTML5).
To include a “type” attribute just use the
<txp:spf_js name="myscript" type="1" />
- Don’t use non-alphanumeric characters in script names (if you try to they’ll be stripped).
- The plugin will convert your script names to lowercase.
- The plugin will throw an error if you try to embed a non-existent script – similar to:
Tag error: -> Textpattern Notice: The requested resource was not found. "script_name".
— In which case check the script exists and your embed tag for typos.
Language support (Textpack)
This plugin uses an English Textpack by default and installs both French (fr-fr) and German (de-de) Textpacks.
To use your own language see the spf_js_textpack file in this repository.
- 0.2 – April 2012 * French & German Textpacks added (thanks Patrick & Uli); * added compatibility with the syntax-highlighting spf_codemirror.
- 0.1 – April 2012 * first release.