ptv_code_transform
Saw Dunstan Orchard’s article about tag redefinition and thought that this could / would be an useful plugin.
No documentation site or anything like that yet as I am still building my website. One will pop up in time.
I would like to point out that all credit for this belongs to Dunstan. I basically made some minor alterations and packaged his code. Although, find bugs, please report them to me instead and not him.
Documentation
Provides one tag
<txp:ptv_code_insert> </txp:ptv_code_insert>
Attribute(s)
filename– Name of file to display. This file should ALWAYS have the ending .txt which must be omitted from the filename attribute.download– Include a download link? (0 | 1). 1 is default
Tag content
- Tag content should contain path to file. Absolute according to webserver root or relative from current path.
- Tag can also be self enclosing in which case it is assumed that the code document resides in current folder.
Examples
<txp:ptv_code_insert filename="ptv_code_transform.php">/code</txp:ptv_code_insert>
(Will display the file ptv_code_transform.php.txt in the directory http://www.webserver.com/code/)
<txp:ptv_code_insert filename="ptv_code_transform.php">../code</txp:ptv_code_insert>
(Will display the file ptv_code_transform.php.txt in parent directory)
<txp:ptv_code_insert filename="ptv_code_transform.php" download="0" />
(Will display the file ptv_code_transform.php.txt in current directory)
Example CSS in the plugin.









You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:
Commented (1)
Just select all, copy, and paste into your favorite text editor to get at the plugin. Opera doesn’t seem to have this problem.
Subscribe to this article's comments RSS feed. [ ? ] View Recent Comments across the site. Get a Gravatar.