Content last modified Monday 6 March 2017
hop to #bottom
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 1 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!


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.


Provides one tag
<txp:ptv_code_insert> </txp:ptv_code_insert>


  • 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.

<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

<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.

Article Request Count:

Archived [?]: orphaned: broken links

Initially released:
Posted here:
24 Mar 2005
Article modified:
21 Apr 2009

You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:

Commenting is closed for this article.

Commented (1)

It’s worth noting that in Firefox 1.5 and IE6, the download link at first appears to lead to a blank file with just the opening and closing PHP tags visible. For some reason the actual code is offset far to the right.

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.

You know you want to visit the Archives.




There are also tag clouds, 'cause those are fun.
Published with Textpattern