Skip to content

MST-Textpattern/spf_ext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spf_ext

External file editor plugin for Textpattern.

Create, edit and delete external (to Textpattern) files in Textpattern admin.

REQUIRES: Texpattern 4.5.1 and PHP 5 and shell access (for sym-linking existing files).

Use version 0.2 for Textpattern 4.4.1.

Please read the instructions and notes below before use.

This plugin creates external files you can manage and edit via the admin interface. All files are saved to the directory you create in step 1 of the instructions below. Syntax highlighting is available via spf_codemirror (currently HTML, PHP and JavaScript – more to come).

DOWNLOAD

Why?

  • This plugin allows you to edit and manage site files residing outside Textpattern within the Textpattern admin area (see ‘Procedure for managing existing files’ below).
  • It offers an easy way to create static files you can edit and access via your page templates: <txp:site_url />ext_files/yourfile.html

Instructions:

  1. Create a directory for the static external files in the root of your textpattern installation called ‘ext_files’ (or whatever you like). You should make sure that PHP is able to write to that directory.
  2. Visit the advanced preferences and make sure the “External files directory” preference contains the directory you created in step 1 (by default ‘ext_files’). This path is relative path to the directory of your root Textpattern installation.
  3. Activate this plugin.
  4. Go to Extensions > External Files and create files you’d like to manage.
  5. Always include a file extension in the file name (.html, .php, etc.).

Procedure for managing existing files:

  1. Copy the contents of the file (called for example myfile.php) into a new file in Extensions > External Files > Create new file.
  2. Name the new file (External file name:) ‘myfile.php’.
  3. Rename the original file (to, for example, ‘myfile_original.php’) – then you’ll have a backup.
  4. Make a symbolic link, in the original file location, to the new file (e.g. cd to the ‘ext_files’ directory and then ‘ln -s /original_directory_path/myfile.php ./myfile.php’).

Notes:

  1. You can only manage files which are read/write to your web server (i.e. within your web root) – e.g. Minify config files, external scripts, etc.
  2. Deleting a file via the External Files tab deletes the actual file in the ‘ext_files’ directory (as well as the database entry) – use with care!.

Languages (Textpack)

This plugin installs an English Textpack by default.

To install a Textpack for your own language see the instructions on GitHub.

Version history

  • 0.4 – 3 December 2012 – fixed a silly typo.
  • 0.31 – 7 November 2012 – rewritten for Textpattern 4.5.×.
  • 0.2 – 26 August 2012 – security enhancements (thanks Jukka).
  • 0.1 – April 2012 – first release.

About

an external file editor for Textpattern

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages