%STARTATTACH{"filename"}% and %ENDATTACH% into an attachment with the given filename.
Pass filename, topic, web or comment as parameters.
The current version only refreshes the attachment when the topic is saved. Obviously this means that the attachment can get out of synch if, for example, it explicitly or implicitly refers to other topics.
This plugin is written specifically to be able to put css into topic(s) and still be able to have efficient stylesheets: i.e., without the overhead of TWiki processing. The feature can be used for many other things where you want TWiki to generate a plain text file a smart way. SEARCH in a topic and save the search results to an XML file. The XML data can be used for efficient look-up.
%STARTATTACH{"filename"}%
content-to-be-saved
%ENDATTACH%
You can pass a number of parameters:
| Parameter | Description | Default | Example |
|---|---|---|---|
topic |
Topic to save the attachment to. | none (the current topic is used) |
topic="WebHome" |
web |
Web where the save topic is located. | none (the current Web is used) |
web="Main" |
comment |
Attachment comment text. | the default ATTACHCONTENTCOMMENT text (see Plugin Settings below) |
comment="User data as of %DATE%" |
hide |
Use hide="on" to hide the attachment in normal topic view. |
off |
hide="on" |
keeppars |
Keep paragraph <p /> tags, <nop> tags, and square bracket type links | The default KEEPPARS setting (see Plugin Settings below) |
keeppars="on" |
USERCOLORSURL.
%STARTATTACH{"userdata.xml" comment="User data as of %DATE%"}%
<?xml version="1.0" encoding="ISO-8859-1"?>
<users>
%SEARCH{ "[F]irstName.*value=.*()" web="%MAINWEB%" type="regex" nonoise="on" excludetopic="UserForm,TWikiContributor,TWikiGuest,UnknownUser" format="<user><firstname><![CDATA[$formfield(FirstName)]]></firstname><lastname><![CDATA[$formfield(LastName)]]></lastname><url><![CDATA[%SCRIPTURL{view}%/%WEB%/$topic]]></url></user>" }%
</users>
%ENDATTACH%
%<plugin>_<setting>%, i.e. %CACHECONTENTPLUGIN_SHORTDESCRIPTION%
data/debug.txt) AttachContentPlugin.zip in your twiki installation directory. Content: | File: | Description: |
|---|---|
data/TWiki/AttachContentPlugin.txt | Plugin topic |
data/TWiki/AttachContentPlugin.txt,v | Plugin topic repository |
lib/TWiki/Plugins/AttachContentPlugin.pm | Plugin Perl module |
| Plugin Author: | TWiki:Main.MeredithLesly, TWiki:Main.KennethLavrsen, TWiki:Main.ArthurClemens |
| Plugin Version: | 16 Apr 2007 (V2.2.0) |
| Change History: | |
| 16 Apr 2007 (2.2.0) | Kenneth Lavrsen: Add added keeppars parameter. Settings change to being plugin settings only. Removal of plugin tags fixed so text between is still visible. |
| 15 Apr 2007 (2.1.0) | Arthur Clemens: added parameters web, topic, comment and hide. Plugin tags are removed from view. Added configurable default comment. |
| 19 Oct 2006 (2.0) | TWiki:Main.KennethLavrsen Fixed major security issue. Original version allowed /../ in the filename so files could be stored everywhere Plugin now cleans up the its work area and no longer leaves temporary files Temporary filenames made pseudo random to avoid race condition Plugin now also removed nops and TML square bracket links Attachment is no longer saved when uploading other files and changing attributes. |
| 09 Feb 2006 (1.0) | Initial version |
| TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 |
| CPAN Dependencies: | none |
| Other Dependencies: | none |
| Perl Version: | 5.005 |
| License: | GPL (GNU General Public License) |
| Benchmarks: | GoodStyle nn%, FormattedSearch nn%, AttachContentPlugin nn% |
| Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/AttachContentPlugin |
| Feedback: | http://TWiki.org/cgi-bin/view/Plugins/AttachContentPluginDev |
| Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/AttachContentPluginAppraisal |