An external file editor plugin.
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 this version for Textpattern 4.4.x
Please read the instructions and notes before use.
- 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:
- 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.
- 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.
- Activate this plugin.
- Go to Extensions > External Files and create files you’d like to manage.
- Always include a file extension in the file name (.html, .php, etc.).
Procedure for managing existing files:
- Copy the contents of the file (called for example myfile.php) into a new file in Extensions > External Files > Create new file.
- Name the new file (External file name:) ‘myfile.php’.
- Rename the original file (to, for example, ‘myfile_original.php’) – then you’ll have a backup.
- 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’).
- 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.
- 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!.