r6 < r5 < r4 |
|
MyCo.MyTopic |
Webs: Myco | Main | TWiki | Sandbox |
|
Changes | Index | Search | Go |
MyCo.MyTopic |
Webs: Myco | Main | TWiki | Sandbox |
|
Changes | Index | Search | Go |
Edit | Attach | Diffs | r2 > r1 | More | |
Revision r1.2 - 13 Feb 2004 - 09:09 GMT - TWikiPresenter |
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding TWiki? Send feedback Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.WebHome. |
the world
is an OblateSpheroid_Everyone_ *knows* that =the world= is an OblateSpheroid
Actually it is perfectly and absolutely flat
_Actually_ it is *perfectly* and __absolutely__ flat
You type | You see |
---|---|
---+ This is a heading | This is a heading |
---++ And so is this | And so is this |
like this
You type | You see |
---|---|
* Bullet * Sub-bullet |
|
1
| Cat | Feline | | Bear | Ursine | | Wolf | Lupine |
Cat | Feline |
Bear | Ursine |
Wolf | Lupine |
[[BumpyWords][bumpy words]] appears as bumpy words
[[http://www.google.com/][Google]]
appears as Google
<nop>
<nop>_word_
appears as _word_
Attachment | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|
myco.gif | manage | 9.6 K | 13 Feb 2004 - 18:41 | MushroomMagicMan | Attached image file |
%ATTACHURL%/myco.gif
to see this:
%SEARCH{"CategoryWeather" nosearch="on" nosummary="on"}%
%CALENDAR...%
%COMMENT...
%CHART...
%EDITTABLE...
%RENDERLIST...
%SLIDESHOWSTART...
%CALC...
%TABLE...
%DRAWING...
configure
, make
, etc.
TWiki web | Tools |
---|---|
Sandbox: Sandbox web to experiment in an open hands-on area | |
TWiki: TWiki documentation, welcome guest and user registration |
This table is updated automatically based on WebPreferences settings of the individual webs. | |||||
Legend: | WebHome | WebSearch | WebChanges | WebNotify | |
WebPreferences | WebStatistics | WebTopicList | WebIndex |
"$SUM( $ABOVE() )"
to TWiki tables or anywhere in topic text ExternalSite:Page
to link to a page on an external site based on aliases defined in a rules topic :-)
as or :eek:
as canCreateWeb($cUID, $web)
method of the user mapping manager is called if the method exists.
If the method returns true, the web is created without checking DENYROOTCHANGE and ALLOWROOTCHANGE (for a top level web) or DENYWEBCHANGE and ALLOWWEBCHANGE (of the parent of a subweb).
If the method does not exist or the method returns false, web creation is permitted as usual based on *ROOTCHANGE or *WEBCHANGE.
The method would be written as follows.
sub canCreateWeb { my( $this, $cUID, $web ) = @_; ... }Similarly, when a web is renamed, the
canRenameWeb($cUID, $oldWeb, $newWeb)
method of the user mapping manager is called if the method exist.
If it returns true, permission check on the parent web is omitted.
If the method does not exist or the method returns false, permission check on the parent web is conducted as usual.
Then, permission check on the rename destination takes place.
Related Topics: AdminDocumentationCategory, TWikiAccessControl, LargeSite, UserSubwebs{SiteLocale}
setting in configure - this enables you to have a slightly different spelling of the character set in the server locale (e.g. 'eucjp') and the HTTP header sent to the browser (e.g. 'euc-jp').
This feature should also support use of Mozilla Browser with TWiki:Codev.TWikiOnMainframe (as long as mainframe web server can convert or pass through UTF-8 URLs) - however, this specific combination is not tested. Other browser-server combinations should not have any problems.
Please note that use of UTF-8 as the site character set is not yet supported - see Phase 2 of TWiki:Codev.ProposedUTF8SupportForI18N for plans and work to date in this area.
This feature is complete in TWiki releases newer than February 2004.
Note for skin developers: is no longer required (TWiki:Plugins.InternationalisingYourSkin).
%WIKIWEBMASTER%
and %WIKIWEBMASTERNAME%
web dependent. They are used on the Access Denied page and other pages as contact.
isAdmin()
method in a user mapping manager normaly recognizes only one argument, $cUID
. (e.g. TWikiUserMapping's)
However, the upstream code hands two additional arguments, namely the topic and web names of the topic currently being processed.
As such, isAdmin()
can be web and topic dependent, which makes it possible to have web admins.
wikiWebMaster
object method taking the following arguments. wikiWebMaster
does not exist or returns a null string (""), %WIKIWEBMASTER%
and %WIKIWEBMASTERNAME%
are expanded to {WebMasterName}
and {WebMasterEmail}
values respectively.
isAdmin()
and wikiWebMaster()
need data source to work.
The data source needs be outside of the web.
Otherwise, there is a possibility of the web admins lose access to the web by some change to the web.
MetadataRepository is one way to have metadata of a web outside the web.
In an example on MetadataRepository, a TWiki group specified by the admin
field of the web's record is the web admins.
Another way is to put such a data on a topic or topics in the TWiki web and make them editable only by TWiki Administrators.
Related Topics: AdminDocumentationCategory, TWikiAccessControl, MetadataRepository, LargeSite, UserMasqueradingtwiki-backup-2024-09-21-03-30.zip
in the backup directory (default /tmp
).
backuprestore
utility can be used to create a backup (scheduled or manually), to copy a backup, and to check on the status of the backup process.
Command | Description |
---|---|
./backuprestore status |
Show backup status. Returns backup_status: 1 if web-based backup is in progress. |
./backuprestore create_backup |
Create a backup. This is done without a background daemon process, e.g. the script returns when the backup is done. |
./backuprestore download_backup <name.zip> |
Dump a backup file to STDOUT. If called as CGI script, download a backup file. |
apache
, nobody
, www-data
, wwwrun
or the like, and depends on the webserver configuration.
twiki/bin
directory before executing the backuprestore
utility.
10 0 * * 0 (cd /path/to/twiki/bin; ./backuprestore create_backup >/dev/null 2>&1)Make sure the plugin is configured properly before creating backups. The backup destination can be local or remote. If remote, the remote server needs to be mounted on the TWiki server via NFS or the like.
{Plugins}{BackupRestorePlugin}{BackupDir}
- Backup destination directory. Default: /tmp
.
{Plugins}{BackupRestorePlugin}{KeepNumberOfBackups}
- keep number of backups (e.g. delete old backups), 0 to keep all. Default: 7
{Plugins}{BackupRestorePlugin}{TempDir}
- temp directory. Default: /tmp
{Plugins}{BackupRestorePlugin}{createZipCmd}
- create zip command. Default: /usr/bin/zip -r
{Plugins}{BackupRestorePlugin}{listZipCmd}
- list zip content command. Default: /usr/bin/unzip -l
{Plugins}{BackupRestorePlugin}{unZipCmd}
- unzip command. Default: /usr/bin/unzip -o
{Plugins}{BackupRestorePlugin}{Debug}
- debug flag. Default: 0
{Plugins}{BackupRestorePlugin}{BackupDir}
configure setting.
twiki-backup-2024-09-21-03-30.zip
- date based names.
data/*
- all data and logs.
pub/*
- all attachments.
working/*
- working data.
working/BackupRestorePlugin/LocalSite.cfg
- TWiki configuration file (if found).
working/BackupRestorePlugin/LocalLib.cfg
- TWiki lib file (if found).
working/BackupRestorePlugin/twiki.conf
- Apache config file (if found).
working/BackupRestorePlugin/version.txt
- contains the TWiki version number of the backup. Used to intelligently restore backup to newer TWiki version. Example: version: TWiki-5.1.0
short: 5.1
working/BackupRestorePlugin/version-long-TWiki-5.1.0.txt
- file with TWiki version in filename
working/BackupRestorePlugin/version-short-5.1.txt
- file with TWiki short-version in filename, name version-short-<major>.<minor>.txt
%BACKUPRESTORE{"..."}%
variable to perform all web-based operations. The variable is used in the BackupRestoreConsole page.
%BACKUPRESTORE{"..."}%
parameters:
Parameter | Explanation | Default |
---|---|---|
action="..." |
Action to take: • "" (empty) - show backup overview console. • "backup_detail" - show backup detail console. • "create_backup" - start new backup. • "cancel_backup" - cancel backup in progress. • "delete_backup" - delete a backup. • "restore_backup" - restore from a backup. • "status" - show backup status (1: backup in progress). • "debug" - debug and diagnostics - {Plugins}{BackupRestorePlugin}{Debug} must be enabled. |
"" (empty) |
file="..." |
Name of backup file to take action. The file parameter is required for the following actions: "backup_detail" , "delete_backup" and "restore_backup" . |
"" |
{Plugins}{BackupRestorePlugin}{BackupDir}
directory.
BackupRestorePlugin.zip
in your twiki installation directory. Content: File: | Description: |
---|---|
bin/backuprestore | CGI/command line utility |
data/TWiki/BackupRestorePlugin.txt | Plugin topic |
data/TWiki/BackupRestoreConsole.txt | Backup and restore console topic |
lib/TWiki/Plugins/BackupRestorePlugin.pm | Plugin Perl module |
lib/TWiki/Plugins/BackupRestorePlugin/CaptureOutput.pm | Perl module |
lib/TWiki/Plugins/BackupRestorePlugin/Core.pm | Core backup module |
lib/TWiki/Plugins/BackupRestorePlugin/ProcDaemon.pm | Perl module |
twiki/lib/LocalSite.cfg
and customize as needed:# Path to backup destination directory. Can be a volume mounted to the file system. $TWiki::cfg{Plugins}{BackupRestorePlugin}{BackupDir} = '/tmp'; # Keep number of backups (e.g. delete old backups), 0 to keep all. $TWiki::cfg{Plugins}{BackupRestorePlugin}{KeepNumberOfBackups} = '7'; # Path to temp directory, used by BackupRestorePlugin daemon for temporary data. $TWiki::cfg{Plugins}{BackupRestorePlugin}{TempDir} = '/tmp'; # Path to zip command with options to recursively archive files and directory. $TWiki::cfg{Plugins}{BackupRestorePlugin}{createZipCmd} = '/usr/bin/zip -r'; # Path to unzip command with options to list all files. $TWiki::cfg{Plugins}{BackupRestorePlugin}{listZipCmd} = '/usr/bin/unzip -l'; # Path to unzip command with options to unzip all files with option to overwrite existing files. $TWiki::cfg{Plugins}{BackupRestorePlugin}{unZipCmd} = '/usr/bin/unzip -o'; # Debug plugin. See output in data/debug.txt $TWiki::cfg{Plugins}{BackupRestorePlugin}{Debug} = 0;
twiki/lib/LocalSite.cfg
file with above $TWiki::cfg
settings and end the file with: 1;
twiki/bin/setlib.cfg
file with this content:my $twikiLibPath = "/path/to/your/twiki/lib"; unshift @INC, $twikiLibPath; 1;
working
directory in the twiki
root (same level as twiki/lib
), and set ownership to the webserver user.
Plugin Author: | TWiki:Main.PeterThoeny, TWiki.org |
Copyright: | © 2011-2018 TWiki:Main.PeterThoeny © 2011-2018 TWiki:TWiki.TWikiContributor © 2004, 2005 Simon Flack (for CPAN:IO::CaptureOutput) © 2007, 2008 David Golden (for CPAN:IO::CaptureOutput) © 1997-2011 by Earl Hood and Detlef Pilzecker (for CPAN:Proc::Daemon) |
License: | GPL (GNU General Public License) |
Plugin Version: | 2018-07-10 |
2018-07-10: | TWikibug:Item7841: Copyright update to 2018 |
2017-12-31: | TWikibug:Item7831: Allow action=debug only if Debug flag set; parameter sanity checks |
2016-01-08: | TWikibug:Item7708: Copyright update to 2016 |
2015-01-09: | TWikibug:Item7604: Switch to GPL v3 |
2013-02-16: | TWikibug:Item7091: Use TWISTY in installation instructions section and change history |
2012-09-03: | TWikibug:Item6837: Doc update with zip utility limitation of 4GB |
2012-01-13: | TWikibug:Item6796: Fixing copyright year to 2012 |
2011-12-19: | TWikibug:Item6799: Improved docs on GNU zip dependency |
2011-09-13: | TWikibug:Item6796: Improved docs on command line use |
2011-09-05: | TWikibug:Item6795: Add restore from backup functionality; upgrade old system topics on restore of old TWiki; describe how to upgrade TWiki |
2011-08-17: | TWikibug:Item6793: Avoid or work around newer APIs to make plugin run on old TWiki-2001-09-01 (Athens Release) for backup |
2011-08-16: | TWikibug:Item6793: Add screenshot; add Config.spec configure file; proper detection of command line mode also for older TWiki versions; use TWiki::Func::registerTagHandler only if available so that plugin can run in older TWiki versions |
2011-08-15: | TWikibug:Item6793: Better error handling; add magic number to download URL to restrict download of backups to TWiki admins only |
2011-08-12: | TWikibug:Item6631: Initial version |
TWiki Dependency: | $TWiki::Plugins::VERSION 1.0 |
CPAN Dependencies: | none ( Proc::Daemon included as TWiki::Plugins::BackupRestorePlugin::ProcDaemon ) ( IO::CaptureOutput included as TWiki::Plugins::BackupRestorePlugin::CaptureOutput ) |
Other Dependencies: | GNU zip and unzip command line utilities |
Perl Version: | 5.005 |
TWiki:Plugins.Benchmark: | GoodStyle nn%, FormattedSearch nn%, BackupRestorePlugin nn% |
Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/BackupRestorePlugin |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/BackupRestorePluginDev |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/BackupRestorePluginAppraisal |
Behaviour
Javascript event library, available from http://bennolan.com/behaviour/.
Behaviour uses CSS selectors to subscribe to Javascript event handlers. This allows to create clean code, separated from HTML (and well suited to create Javascript based interaction that degrades nicely when Javascript is not available).
From the website:
After all the work of WASP and others to promote clean markup, valid pages and graceful degradation via css - it sucks that we're going back to tag soup days by throwing javascript tags into our html. The better way to do javascript is to do it unobtrusively. PPK and Simon Willison have been recommending this approach for ages. And it's definitely the way to go. The only problem is that it's a bit of a pain in the ass. That's why I came up with Behaviour - my solution to unobtrusive javascript behaviours. How does it work? Behaviour lets you use CSS selectors to specify elements to add javascript events to. This means that instead of writing:<li> <a onclick="this.parentNode.removeChild(this)" href="#"> Click me to delete me </a> </li>You can use:<ul id="example"> <li> <a href="/someurl">Click me to delete me</a> </li> </ul>And then use css selectors to select that element and add javascript functions to it.var myrules = { '#example li' : function(el){ el.onclick = function(){ this.parentNode.removeChild(this); } } }; Behaviour.register(myrules);
In your code you create a "rules" object, with sub-objects for each html element class name or id:<script type="text/javascript" src="%PUBURL%/%SYSTEMWEB%/BehaviourContrib/behaviour.js"></script>
Apply the rules with:var myrules = { '.classname' : function(element) { // element event element.onclick = function() { // code here } }, '#id' : function(element) { // element event element.onclick = function() { // code here } } };Or use nested identifiers:var myrules = { '.menu li a' : function(element) { element.onclick = function() { // code here } } };
Behaviour.register(myrules);
Creates:<div id="demoblock" style="padding:1em; width:100px; text-align:center;"> MOUSE OVER ME </div> <script type="text/javascript"> // <![CDATA[ var myrules = { '#demoblock' : function(el) { var defaultColor = '#A3D6F8'; var highlightColor = '#4A7FB5'; el.style.backgroundColor = defaultColor; el.onmouseover = function() { this.style.backgroundColor = highlightColor; return false; } el.onmouseout = function() { this.style.backgroundColor = defaultColor; return false; } }, '#demoblock span' : function(el) { var text = el.innerHTML; var fisherYates = function (inArray) { var i = inArray.length; if ( i == 0 ) return false; while ( --i ) { var j = Math.floor( Math.random() * ( i + 1 ) ); var tempi = inArray[i]; var tempj = inArray[j]; inArray[i] = tempj; inArray[j] = tempi; } } var randomize = function(inText) { var letters = inText.split(''); fisherYates(letters); return letters.join(''); } el.onmouseover = function() { this.innerHTML = randomize(text); return false; } el.onmouseout = function() { this.innerHTML = text; return false; } } }; Behaviour.register(myrules); // ]]> </script>
null
:
var myrules = { 'table.test td' : function(element) { element.onmouseover = function() { this.style.backgroundColor = highlightColor; return false; } element = null; // by setting this IE will not leak } }; Behaviour.register(myrules);
BehaviourContrib.zip
in your twiki installation directory.
Behaviour
Javascript event library to create Javascript based interactions that degrade well when Javascript is not available
Author: | TWiki:Main/ArthurClemens |
Copyright: | Code: behaviour.js version 1.1 - Copyright (c) Ben Nolan and Simon Willison.TWiki distribution and updates/additions: © TWiki:Main/ArthurClemens. © 2006-2018 TWiki:TWiki/TWikiContributor |
License: | BSD for behaviour.js GPL (GNU General Public License) for TWiki BehaviourContrib |
Version: | 30438 (2018-07-16) |
Dependencies: | None |
Contrib Version: | 2018-07-05 |
Change History: | |
2018-07-05: | TWikibug:Item7841: Copyright update to 2018 |
2016-01-08: | TWikibug:Item7708: Copyright update to 2016 |
2015-02-16: | TWikibug:Item7604: Switch from GPL v2 to v3 |
2010-05-15: | TWikibug:Item6433 - doc improvements; replacing TWIKIWEB with SYSTEMWEB |
17 Oct 2007 | 1.3 Replaced "faster code" by other code from Dean Edwards, [[ packed by http://groups.google.com/group/behaviour/browse_thread/thread/85137977bedf5ed/3cf3ba8065d41a8c#3cf3ba8065d41a8c][Raymond Irving]]. |
02 Jul 2007 | 1.2 Integrated other faster code by Dean Edwards: faster onload (again). |
08 Mar 2007 | 1.1 Integrated code by Dean Edwards (see Code update version 1.1 with faster DOM queries). |
04 Jun 2006 | 1.0 First Version. Included Behaviour version: 1.1. |
Home: | http://TWiki.org/cgi-bin/view/Plugins/BehaviourContrib |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/BehaviourContribDev |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/BehaviourContribAppraisal |
<noautolink> %EDITTABLE{}% | FirstName | LastName | Email | WikiName | | Test | User | you@example.com | TestUser | </noautolink>Usage:
<noautolink> %EDITTABLE{}% | FirstName | LastName | Email | WikiName | CustomFieldThis | SomeOtherRandomField | WhateverYouLike | | Test | User | you@example.com | TestUser | A | B | C | </noautolink>
CgiContrib.zip
in your twiki installation directory. Content: File: | Description: |
---|---|
lib/CGI.pm | unchanged CPAN module |
lib/CGI/Carp.pm | unchanged CPAN module |
lib/CGI/Cookie.pm | unchanged CPAN module |
lib/CGI/File/Temp.pm | unchanged CPAN module |
lib/CGI/Pretty.pm | unchanged CPAN module |
lib/CGI/Push.pm | unchanged CPAN module |
lib/CGI/Util.pm | unchanged CPAN module |
lib/Fh.pm | unchanged CPAN module |
data/TWiki/CgiContrib.txt | Documentation |
lib/TWiki/Contrib/CgiContrib.pm | Perl module |
Author: | TWiki:Main.TWikiContributor | ||||||
Copyright: | © 2015-2018 Peter Thoeny; © 2015-2018 TWiki Contributors |
||||||
License: | GPL (GNU General Public License) | ||||||
Dependencies: |
|
||||||
Version: | 2018-07-05 | ||||||
Change History: | |||||||
2018-07-05: | TWikibug:Item7841: Copyright update to 2018 | ||||||
2016-01-08: | TWikibug:Item7708: Copyright update to 2016 | ||||||
2015-11-29: | Initial version | ||||||
Home: | http://TWiki.org/cgi-bin/view/Plugins/CgiContrib | ||||||
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/CgiContribDev | ||||||
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/CgiContribAppraisal |
* Set Email = user@example.comIf your user topic is not protected from changes by other people, and you don't register an e-mail address using this form, then your user account could be hijacked by someone else. If your old e-mail addresses are all invalid (you can't receive mail there any more) and you have forgotten your password, please contact WebServer@inversion-lab.com for help.
new
method used to create new object instances. For example,
my $mobile = new Telecoms();or
my $mobile = Telecoms->new();Related Topics: StaticMethod, ObjectMethod, DeveloperDocumentationCategory
color
type to TWikiForms:
Type | Description | Size | Value |
---|---|---|---|
color |
Single-line text box and a color picker to pick a color. The color can also be typed into the text box, such as #123456 . An attribute of type="popup" shows a button that, when clicked, opens a color picker popup. |
Text box width in number of characters | Initial (default) color |
Name: | Type: | Size | Values: | Tooltip message: | Attributes: |
---|---|---|---|---|---|
Background color | color | 12 | Select color | type="popup" |
type="popup"
attribute requires TWiki-6.0.2 or later.
<form action="..."> %COLORPICKER{ name="text_color" size="12" value="#123456" class="twikiInputField" }% <form>This will show an HTML input field named "text_color" and a color picker tied to it.
Parameter | Description | Default | Example |
---|---|---|---|
name |
Name of input field | (required) | name="text_color" |
value |
Initial color value, in hexadecimal notation for the combination of Red, Green, and Blue color values (RGB). | (none) | value="#0000ff" |
size |
Size of input field, in number of characters | (browser default) | size="8" |
class |
CSS class of input field or the rectangular color block | (none) | class="twikiInputField" |
style |
Style of input field or the rectangular color block | (none) | style="width: 190px; height: 32px" |
type |
Type of color widget: • "below" - color picker is located below the input field;• "popup" - pop-up a color picker window when clicking the button next to the input field (this uses very little vertical space); • "view" - a read-only rectangular block colored in the color value (no color picker);• "view-hex" - like view , in addition shows the color value as an RGB hexadecimal code (no color picker); |
type="below" |
type="view-hex" |
Additional parameters can be supplied; they will be added to the HTML input field or the rectangular color block. |
%INCLUDE{ "%SYSTEMWEB%.ColorPickerPlugin" section="code" }% <form action="..."> %INCLUDE{ "%SYSTEMWEB%.ColorPickerPlugin" section="picker" NAME="demo_color" SIZE="12" VALUE="#123456" EXTRA="class=\"twikiInputField\"" }% </form>This will show an HTML input field named "demo_color" and a color picker tied to it. The
"code"
section should be included once per topic, the "picker"
section can be included as many times as needed. The NAME
parameter is required; SIZE
, VALUE
and EXTRA
parameters are optional. Use the EXTRA
parameter to add additional parameters to the HTML input field.
Test: (this works only if the ColorPickerPlugin is installed and disabled)
ColorPickerPlugin.zip
in your twiki installation directory.
Author: | TWiki:Main.PeterThoeny, TWiki.org |
Copyright: | © 2007 Steven Wittens, Acko.net for Farbtastic jQuery plugin © 2010-2018 TWiki:Main.PeterThoeny and TWiki:TWiki.TWikiContributor for TWiki ColorPickerPlugin |
Sponsor: | Wave Systems Corp. for type parameter |
License: | GPL (GNU General Public License) |
Dependencies: | JQueryPlugin (pre-installed) |
Version: | 2018-07-05 |
2018-07-05: | TWikibug:Item7841: Copyright update to 2018 |
2016-01-08: | TWikibug:Item7708: Copyright update to 2016 |
2015-01-10: | TWikibug:Item7604: Switch to GPL v3 |
2014-12-29: | TWikibug:Item7601: Implement new type="popup" parameter for popup color widget |
2014-12-20: | TWikibug:Item7601: New type parameter to set the type of color widget |
2014-12-11: | TWikibug:Item7577: TWiki form field type with configure attributes, color type supports form, onblur, onfocus, onchange, onselect, onmouseover, onmouseout, pattern, placeholder, spellcheck, style, tabindex, title, translate |
2013-02-15: | TWikibug:Item7148: Fix for color picker not working if initial value of TWiki forms field of type color is empty |
2013-01-09: | TWikibug:Item7091: Dependency clarification; use TWISTY for installation instructions |
2012-12-03: | TWikibug:Item7020: Add VarCOLORPICKER with category; doc improvements |
2012-08-11: | TWikibug:Item6837: Doc fixes; updated installation instructions |
2011-06-11: | TWikibug:Item6725: Change global package variables from "use vars" to "our" |
2010-11-30: | TWikibug:Item6610: Rewrite ColorPickerContrib into ColorPickerPlugin |
2010-11-27: | TWikibug:Item6609: In TWikiForms type table, automatically list the color form field type defined in this contrib -- TWiki:Main.PeterThoeny |
2010-11-26: | TWikibug:Item6606: Complete rewrite of contrib using Farbtastic color picker -- TWiki:Main.PeterThoeny |
2006-10-27: | Initial version of ColorPickerContrib by TWiki:Main.FlavioCurti using Colorpicker by Norman Timmler (inlet media e.K., Hamburg, Germany) |
%COMMENT{attributes}%
anywhere in a TWiki topic.
%COMMENT%
without parameters shows a simple text box.
%COMMENT{}%
can handle the following parameters: Parameter | Description | Default |
---|---|---|
type | This is the name of the template to use for this comment. Comment templates are defined in a TWiki template - see customization. If this attribute is not defined, the type is whatever is defined by COMMENTPLUGIN_DEFAULT_TYPE, either in this topic or in your WebPreferences. | "below" |
default | Default text to put into the textarea of the prompt. | |
target | Name of the topic to add the comment to | the current topic |
location | Regular expression specifying the comment location in the target topic. Read carefully the CommentPlugin documentation! | |
mode | For compatibility with older versions only, synonymous with type | |
nonotify | Set to "on" to disable change notification for target topics | "off" |
noform | Set to "on" to disable the automatic form that encloses your comment block - remember to insert <form> tags yourself! See CommentPluginExamples#noform for an example. | "off" |
nopost | Set to "on" to disable insertion of the posted text into the topic. | "off" |
remove | Set to "on" to remove the comment prompt after the first time it is clicked. | "off" |
button | Button label text | "Add comment" |
emailto | Send comment by email. Use comma "," to seperate multiple email addresses. This feature is disabled by default. To enable this feature, please set up "$TWiki::cfg{Plugins}{CommentPlugin}{EmailEnabled} = 1;". |
%COMMENT
supports several ways to specify where a comment should be inserted in the target topic. This is referred to as the location of the comment.
%COMMENT
tag %COMMENT
tag itself. For example:
%COMMENT{type="below"}%will add comments in the current topic, directly below the
%COMMENT
tag.
target
attribute may specify a web, and may also specify an anchor within the target topic; for example,
%COMMENT{type="above" target="%USERSWEB%.PersonalRemarks#InsertHere"}%This uses a standard TWiki in-topic anchor as the insertion location. See TextFormattingRules for more about TWiki anchors.
location
parameter. The target topic is searched for the regular expression, and the comment inserted relative to the string that the search matched. For example,
%COMMENT{type="above" location="Flights of Fancy"}%will place comments above the first occurrence of the string
Flights of Fancy
in the current topic.
Warning of course, if a user's comment contains the string "Flights of Fancy" they may and up changing the location for the next comment! Also, if you use a tag in the location, then you've just inserted another tag in the page that contains the %COMMENT
! So be very careful how you specify the RE for location
. Note that the RE is matched using perl "multiple line" mode, so ^ and $ match the start of a line and the end of a line respectively. location="
just before the location.
I look forward to someone leveraging this feature to create - for example - threaded conversations using %COMMENT
.
If you specify an anchor and a location
, the anchor will be ignored.
Template type | Description |
---|---|
top |
Comments, signed and dated (server time), added at top of the topic (the anchor is ignored) |
bottom |
Comments, signed and dated (server time), added at end of the target topic (the anchor is ignored) |
above |
Comments, signed and dated (server time), added immediately before the target anchor, or the %COMMENT if no anchor is specified |
below |
Comments, signed and dated (server time), added immediately below the target anchor, or the %COMMENT if no anchor is specified |
belowthreadmode |
Comments, signed and dated, added recurse after comment box |
threadmode |
Wiki thread mode comment, signed and dated (server time) |
tableprepend |
Comments, signed and dated (server time), formatted as an HTML table row, added below the anchor (which must be in an HTML <table>) |
tableappend |
Comments, signed and dated (server time), formatted as an HTML table row, added above the anchor (which must be in an HTML <table>) |
action |
Action added to action table directly above comment box (see Plugin Installation Instructions below for important notes) |
table |
Tablerows adding on end |
toctalk |
Talk using TOC adding on end |
bookmark |
Create a list of annotated bookmarks |
return |
Post to a different topic and return |
PROMPT:mytype
and OUTPUT:mytype
respectively. See comments.tmpl
in the templates directory for examples.
The plugin picks up these template definitions from a standard TWiki template file, templates/comments.tmpl
. This allows different templates to be defined for different TWiki skins.
templates/comments.tmpl
includes the topic CommentPluginTemplate, which contains all the shipped standard templates and in turn includes TWiki.UserCommentsTemplate that can include non-standard customizations.
This allows for several levels of customization: comments.tmpl
to include a different topic (this customization will be lost next time you upgrade, though).
UserCommentsTemplate
to the web (this will replace TWiki.UserCommentsTemplate)
templatetopic
parameter. For example:
%COMMENT{type="blogpost" templatetopic="BlogPostCommentTemplate" target="CommentPlugin" button="Add comment" }%
templatetopic
accepts topic
or web.topic
syntax. See an example in CommentPluginExamples#TemplateTopic.
If you use any topic other than UserCommentTemplate, it is critically important that you include this line at the end of your comment template topic:
%TMPL:INCLUDE{"%SYSTEMWEB%.CommentPlugin"}%Without this line your templates will not be picked up. Templates are picked up by following the standard TWiki rules for locating template files. Note that you can use
%TMPL:INCLUDE%
to include other files of templates. PROMPT
and an OUTPUT
definition:
%TMPL:DEF{PROMPT:myComment}%%TMPL:P{promptbox}%%TMPL:END% %TMPL:DEF{OUTPUT:myComment}%%TMPL:P{outputoneliner}%%POS:TOP% %TMPL:END%Call your custom comment with:
%COMMENT{type="myComment"}%
PROMPT
template PROMPT
template defines the contents of an HTML form that is used to capture the comment. This form invokes the comment generator when submitted. Parameters to the comment generator are defined using standard HTML input fields, such as input
, textarea
and select
. The user enters values for these parameters, and these are then available when the OUTPUT
template is expanded, in the form of %URLPARAM%
s.
Note that you must define a "submit" button if you want the form to work!
Only the input fields of the form need be defined. The plugin automatically generates the <form>
and </form>
tags, with these two exceptions:
noform="on"
parameter. In this case, the PROMPT
template has to specify the form tags and some additional hidden input fields. See CommentPluginExamples#noform example.
PROMPT
template contains %COMMENTFORMSTART%
and %COMMENTFORMEND%
, which gives control over where to add the form tags and the hidden input fields: %COMMENTFORMSTART%
- HTML form start tag
%COMMENTFORMEND%
- hidden input fields and HTML form end tag
PROMPT
template that contains more than one form, such as a comment plugin prompt form, and a second form with a "notify authors" button (see TWiki:Plugins.NotifyAuthorsPlugin).
Example PROMPT
template with two forms:
%TMPL:DEF{PROMPT:two_form_demo}% %COMMENTFORMSTART% <!-- form start tag --> <textarea %DISABLED% rows="%rows|5%" cols="%cols|80%" name="comment"></textarea> <input %DISABLED% type="submit" value="%button|Add comment%" class="twikiButton" /> %COMMENTFORMEND% <!-- hidden input fields and form end tag --> %NOTIFYAUTHORS% <!-- second form with notify authors button --> %TMPL:END%
%COMMENT
tag that is not one of the standard attributes, then that attribute is taken as the name of a parameter to be expanded in the PROMPT
template. Expressions in the template of the form %
param|
default%
(e.g. %rows|3%
, %button|Push me%
) are expanded to the values given in the %COMMENT
. For example, if the PROMPT
template 'example' contains:
<textarea rows=%rows|3% cols="%cols|50%" value="%tval|Rubbish%">and the %COMMENT tag is:
%COMMENT{type="example" cols="75"}%then the template will be expanded as
<textarea rows="3" cols="75" value="Rubbish">
PROMPT
definition:
Variable | Description |
---|---|
%DISABLED% |
Set to 'disabled' when you cannot comment (e.g. in preview mode). |
%MESSAGE% |
The text specified by default . This may be overridden by a helpful message when the prompt is DISABLED. |
save
script is invoked on the target topic, with a number of parameters provided by the comment form. Normally the CommentPlugin will provide these fields in the form, but experts can also provide the fields themselves in order to get finer control over what is submitted, or you might want to define your own HTML forms that do comment submission. The parameters that the CommentPlugin recognises are as follows:
CGI parameter | Description |
---|---|
comment_action |
Must be save to get the CommentPlugin to perform |
comment_type |
Type of the OUTPUT template |
comment_index |
Zero-based index of the %COMMENT in the source topic. Used to place a post relative to an existing %COMMENT. |
comment_anchor |
Anchor taken from the target spec |
comment_location |
As passed to %COMMENT |
comment_nonotify |
As passed to %COMMENT |
comment_remove |
Zero-based index of a %COMMENT to remove from the target topic |
comment_nopost |
As passed to %COMMENT |
comment_templatetopic |
As passed to %COMMENT |
comment_location
overrides comment_anchor
, and both override comment_index
. Example, shows an "I Approve" button that adds your approval signature to the end of the topic:
<form method="post" action="%SCRIPTURL{save}%/TWiki/CommentPlugin"> <input type="submit" value="I Approve" /> <input type="hidden" name="comment_action" value="save" /> <input type="hidden" name="comment_type" value="bottom" /> <input type="hidden" name="comment" value="I Approve" /> </form>
%COMMENTPROMPT%
; the prompt will be positioned here.
noform="on"
templatetopic
to point to the topic with the form template
%TMPL:DEF{FORM:example}% <form method="post" action="%SCRIPTURL{save}%/%BASEWEB%/%BASETOPIC%" enctype="application/x-www-form-urlencoded" name="examplecomment" id="examplecomment"> <input type="hidden" name="redirectto" value="%BASEWEB%.%BASETOPIC%" /> %COMMENTPROMPT% </form> %TMPL:END%Example comment:
%COMMENT{noform="on" type="example" templatetopic="Sandbox.CommentPluginTemplateExample" target="CommentPlugin" button="Add comment" }%
OUTPUT
template OUTPUT
template defines the format for the text that actually gets embedded into the topic. All the usual TWiki variables are available in the PROMPT
definition, but note that they get expanded when the comment is inserted in the text, so time, date and username will refer to the time and date when the comment was made, and the user who made it.
There are also four position tags that are used to indicate where the comment should be placed, relative to the location
defined in the %COMMENT
tag:
%POS:TOP% |
If present, comments will be inserted at the top of the topic i.e. before any other text |
%POS:BOTTOM% |
If present, comments will be inserted at the end of the topic i.e. after all existing text |
%POS:BEFORE% |
If present, comments will be inserted immediately before the %COMMENT% tag |
%POS:AFTER% |
If present, comments will be inserted immediately after the %COMMENT% tag |
COMMENTPLUGIN_DEFAULT_TYPE
%COMMENTPROMPT% |
Use with a custom form. If present, the comment prompt will be positioned here. |
OUTPUT
template. See TWikiVariables for details.
COMMENTPLUGIN_DEFAULT_TYPE
setting, add a * Set COMMENTPLUGIN_DEFAULT_TYPE = ...
bullet in Main.TWikiPreferences.
twiki/templates
directory that contains the comment templates. The default 'comments.tmpl' automatically includes user templates from TWiki.CommentPluginTemplate, which in turn includes TWiki.UserCommentsTemplate. CommentPlugin.zip
in your twiki installation directory.
action
template then you must also: {PluginsOrder}
configuration option (in configure
)
Plugin Author: | TWiki:Main.CrawfordCurrie http://www.c-dot.co.uk inspired by the work of TWiki:Main.DavidWeller and TWiki:Main.PeterMasiar |
Copyright: | © 2004, TWiki:Main.CrawfordCurrie; © 2009 TWiki:Main.SopanShewale; © 2004-2018 TWiki:Main.PeterThoeny; © 2004-2018 TWiki:TWiki.TWikiContributor |
License: | GPL (GNU General Public License) |
Plugin Version: | 2018-07-05 |
2018-07-05: | TWikibug:Item7841: Copyright update to 2018 |
2016-01-08: | TWikibug:Item7708: Copyright update to 2016 |
2015-01-10: | TWikibug:Item7604: Switch to GPL v3 |
2013-02-10: | TWikibug:Item7141: Control over where to add the form tag in comment PROMPT template -- TWiki:Main.PeterThoeny |
2013-02-06: | TWikibug:Item7139: Use BUBBLESIGNATUREFORMAT if defined, showing nice bubble boxes around around default comments -- TWiki:Main.PeterThoeny |
2013-01-09: | TWikibug:Item7123: Use TWISTY in plugin settings section, installation instructions and change history |
2013-01-04: | TWikibug:Item7115: Configurable signatures with profile pictures - use SIGNATUREFORMAT setting in default comment box signature -- TWiki:Main.PeterThoeny |
2012-11-16: | TWikibug:Item7039: Adapting it to the enhnaced TWiki::Func::getScriptUrl() -- TWiki:Main.HideyoImazu |
2012-11-12: | TWikibug:Item6967: Better layout of default comment box -- TWiki:Main.PeterThoeny |
2012-11-11: | TWikibug:Item7020: Categorize TWiki Variable COMMENT -- TWiki:Main.PeterThoeny |
2012-09-26: | TWikibug:Item6945: Send comment to multiple email addresses. |
2012-09-26: | TWikibug:Item6944: Get script URL with TWiki::Func::getMasterWebScriptUrl. |
2011-06-16: | TWikibug:Item6754: Fix for action comment template missing %ENDACTION% -- TWiki:Main.JohnRouillard |
2011-06-12: | TWikibug:Item6725: Change global package variables from "use vars" to "our"; adding NO_PREFS_IN_TOPIC in plugin package -- TWiki:Main.PeterThoeny |
2011-03-28: | TWikibug:Item6672 - doc improvements: Adding link to HIDE |
2010-12-11: | TWikibug:Item6530 - doc improvements -- TWiki:Main.ScottGutman |
2010-05-16: | TWikibug:Item6433 - doc improvements |
2010-03-19 | TWikibug:Item6404 Use $br in newline parameter for break tag instead of turning off encoding -- TWiki:Main/PeterThoeny |
2010-02-27 | TWikibug:Item6276 Cannot specify percentBRpercent for newline value -- TWiki:Main/SopanShewale |
2009-01-21 | TWikibug:Item6163 Fix for Comment Plugin losing data if target anchor is missing -- TWiki:Main/TimotheLitt and TWiki:Main/SopanShewale |
03 Aug 2008 | The TWiki 4.2.1 release version |
11 Apr 2008 | TWikibug:Item5518 corrected the template definition for bulletabove |
5 Sep 2007 | TWikibug:Item3689 corrected location handling TWikibug:Item4181 added VarCOMMENT TWikibug:Item4402 corrected access check |
22 Jun 2007 | Removed the long-deprecated %TIME (use %GMTIME instead). Minor doc changes |
14021 | TWikibug:Item3755 Fixed incorrect handling of line terminators when targeting an anchor |
13311 | Added option to define a comment template in any topic. Pass the topic location with templatetopic (either topic or web.topic ). See an example in CommentPluginExamples:templatetopic. |
12822 | TWikibug:Item3598 minor doc fixes |
12750 | TWikibug:Item3510 added a note about the changed template spec in TWiki 4.1.0. Code remains unchanged |
11358 | TWikibug:Item2802 moved SHORTDESCRIPTION to .pm. Coded up TWiki:Main/PankajPant's suggestions as nopost and remove . Added default text for the %COMMENT as requested by TWiki:Main.AndyGlew |
11118 | TWikibug:Item2322 removed span tag around oneliner bullet output |
8788 | TWikibug:Item1465 Item1577: reverted 8433 to fix inclusion of correct user templates |
8787 | TWikibug:Item1573 renamed standard templates topic to avoid naming clash on Windows, where filenames are case-insensitive |
8433 | TWikibug:Item1465 Fix 'TWiki.' to '%TWIKIWEB%.'; also fixed include 'UserComments' to 'UserCommentsTemplate' (at least that is what the doc suggests) |
7427 | TWikibug:Item845 removed duplicate date in default comments; stick with server time |
7251 | TWikibug:Item810 fix for user template inclusion; reorganised templates to make customisation easier |
5906 | TWikibug:Item143 apache warning from comment plugin when CommentsTmpl.txt not found |
5519 | CommentPluginOnAnchorsBroken: incorporated JacobEisinger's fix |
5518 | CommentPluginOnAnchorsBroken: incorporated OlivierBerger's fix |
5455 | On Niels Kodslo's prompting, removed the global recursion prevention that I believe is no longer needed. |
5280 | Removed templates, and some minor fixes |
5250 | Removed newlines from prompt box |
4902 | Changed to use viewauth. Moved templates into user topics. |
4901 | Added templates in user webs support |
4897 | Fixes for disabling during preview; re-enabled old legacy parameters |
4889 | Chopped down from PeterMasiar version, removing several parameters, savecomment script, changing way templates are done. Major rewrite, atcherly. |
4882 | Update from PeterMasiar's 2.0 version, plus documentation and small code improvements. |
4745 | 06 Mar 2002 initial commit |
top
bottom
above
below
bulletabove
inputsize="20"
:
threadmode
belowthreadmode
tableprepend
Tablepreprend comment output 2 | TWikiContributor | 26 Nov 2006 - 11:03 |
Tablepreprend comment output 1 | TWikiContributor | 26 Nov 2006 - 11:02 |
tableappend
Tableappend comment output 1 | TWikiContributor | 26 Nov 2006 - 10:38 |
Tableappend comment output 2 | TWikiContributor | 26 Nov 2006 - 10:39 |
after
action
table
1 Dec 2007 | TWikiContributor | Athens |
1 Jan 2008 | TWikiContributor | Beijing |
toctalk
bookmark
return
Warning: Can't find topic TWiki.COMMENT_TOPIC
noform
templatetopic
encode="off"
in the URLPARAM variable. The newline=""
parameter of URLPARAM gets encoded with the same encoding as the actual URL parameter. In TWiki 5.0 and later you can specify newline="$br"
to add a <br />
, regardless of the encoding used.
%TMPL:DEF{promptbox}%<div class="commentPlugin commentPluginPromptBox" style="margin: 5px 0;">%IF{ "istopic '%SYSTEMWEB%.ScrollBoxAddOn'" then="$percntINCLUDE{ \"%SYSTEMWEB%.ScrollBoxAddOn\" section=\"scroll_box_engine\" }$percnt $percntINCLUDE{ \"%SYSTEMWEB%.ScrollBoxAddOn\" section=\"static_box_start\" boxstyle=\"padding: 7px; width: auto; background-color: #f6f6fb;\" }$percnt" }% <div><textarea %DISABLED% rows="%rows|5%" cols="%cols|80%" name="comment" class="twikiTextarea" wrap="soft" style="width: 100%" onfocus="if(this.value=='%MESSAGE%')this.value=''" onblur="if(this.value=='')this.value='%MESSAGE%'">%MESSAGE%</textarea></div><div style="padding: 5px 0 0 0;"><input %DISABLED% type="submit" value="%button|Add comment%" class="twikiButton" /></div> %IF{ "istopic '%SYSTEMWEB%.ScrollBoxAddOn'" then="$percntINCLUDE{ \"%SYSTEMWEB%.ScrollBoxAddOn\" section=\"static_box_end\" }$percnt" }%</div><!--/commentPlugin-->%TMPL:END%Short comment, signed and dated
%TMPL:DEF{outputoneliner}% * %URLPARAM{"comment"}% -- %WIKIUSERNAME% - %DATE%%TMPL:END%See rendered template Default
%TMPL:DEF{PROMPT:top}%%TMPL:P{promptbox}%%TMPL:END%
%TMPL:DEF{OUTPUT:top}%%TMPL:P{outputoneliner}%%POS:TOP% %TMPL:END%See rendered template top
%TMPL:DEF{PROMPT:bottom}%%TMPL:P{promptbox}%%TMPL:END%
%TMPL:DEF{OUTPUT:bottom}%%POS:BOTTOM%%TMPL:P{outputoneliner}%%TMPL:END%See rendered template bottom
%TMPL:DEF{PROMPT:above}%%TMPL:P{promptbox}%%TMPL:END%
%TMPL:DEF{OUTPUT:above}%%POS:BEFORE%%TMPL:P{OUTPUT:threadmode}%%TMPL:END%See rendered template above
inputsize
, for example:
%COMMENT{type="bulletabove" inputsize="20"}%
%TMPL:DEF{PROMPT:bulletabove}%<input class="twikiInputField" name="bullet_above_item" id="bullet_above_item" type="text" size="%inputsize|40%" value="%URLPARAM{"bullet_above_item"}%" /> <input %DISABLED% type="submit" value="%button|Add item%" class="twikiButton" />%TMPL:END%
%TMPL:DEF{OUTPUT:bulletabove}% * %URLPARAM{"bullet_above_item"}%%POS:BEFORE% %TMPL:END%See rendered template bulletabove
%TMPL:DEF{PROMPT:threadmode}%%TMPL:P{promptbox}%%TMPL:END%
%TMPL:DEF{OUTPUT:threadmode}%%POS:BEFORE% %URLPARAM{"comment"}% %STARTSECTION{ type="expandvariables" }%%IF{ "defined 'BUBBLESIGNATUREFORMAT'" then="$percntBUBBLESIGNATUREFORMAT$percnt" else="-- $percntWIKIUSERNAME$percnt - $percntDATE$percnt" }%%ENDSECTION{ type="expandvariables" }% %TMPL:END%See rendered template threadmode
%TMPL:DEF{PROMPT:belowthreadmode}%%TMPL:P{promptbox}%%TMPL:END%
%TMPL:DEF{OUTPUT:belowthreadmode}%%POS:AFTER% ---++++ %WIKIUSERNAME% - %SERVERTIME% %URLPARAM{"comment"}% %TMPL:END%See rendered template belowthreadmode
%TMPL:DEF{PROMPT:below}%%TMPL:P{promptbox}%%TMPL:END%
%TMPL:DEF{OUTPUT:below}%%POS:AFTER%%TMPL:P{outputoneliner}% %TMPL:END%See rendered template below
%TMPL:DEF{PROMPT:tableprepend}%%TMPL:P{promptbox}%%TMPL:END%
%TMPL:DEF{OUTPUT:tableprepend}%%POS:AFTER%| %URLPARAM{"comment" newline="$br"}% | %WIKIUSERNAME% | %SERVERTIME% | %TMPL:END%See rendered template tableprepend
%TMPL:DEF{PROMPT:tableappend}%%TMPL:P{promptbox}%%TMPL:END%
%TMPL:DEF{OUTPUT:tableappend}%%POS:BEFORE%| %URLPARAM{"comment" newline="$br"}% | %WIKIUSERNAME% | %SERVERTIME% | %TMPL:END%See rendered template tableappend
%TMPL:DEF{PROMPT:after}%%TMPL:P{promptbox}%%TMPL:END%
%TMPL:DEF{OUTPUT:after}%%NOP%%TMPL:P{outputoneliner}% %POS:BEFORE%%TMPL:END%See rendered template after
%TMPL:DEF{PROMPT:action}% %TABLE{databg="#ffffff" tableborder="0" cellborder="0"}% | <label for="action_who">Action for</label>| <input class="twikiInputField" name="action_who" id="action_who" type="text" size="50" value="%URLPARAM{"who"}%" /> | | <label for="action_due">Due date</label>| <input class="twikiInputField" name="action_due" id="action_due" type="text" size="30" value="%URLPARAM{"due"}%" /> | | <label for="action_comment">Comment</label>| <textarea %DISABLED% rows="%rows|3%" cols="%cols|50%" name="action_comment" id="action_comment" class="twikiInputField" wrap="soft" onfocus="if(this.value=='%MESSAGE%')this.value=''" onblur="if(this.value=='')this.value='%MESSAGE%'">%MESSAGE%</textarea> | || <input %DISABLED% type="submit" class="twikiButton" value="Add action" /> | %TMPL:END%
%TMPL:DEF{OUTPUT:action}%%POS:BEFORE%%AC%NOP%TION{who="%URLPARAM{"action_who"}%" due="%URLPARAM{"action_due"}%"}% %URLPARAM{"action_comment" newline="<br />"}%<br />- Created by %WIKIUSERNAME%, %SERVERTIME% %ENDAC%NOP%TION% %TMPL:END%See rendered template action
%TMPL:DEF{PROMPT:table}% %TABLE{databg="#ffffff" tableborder="0" cellborder="0"}% | <label for="comment_date">Date</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_date" id="comment_date" /> | | <label for="comment_city">City</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_city" id="comment_city" value="" /> | || <input %DISABLED% type="submit" class="twikiButton" value="%button|Add entry%" /> | %TMPL:END%
%TMPL:DEF{OUTPUT:table}%%POS:BEFORE%| %URLPARAM{"comment_date"}% | %WIKIUSERNAME% | %URLPARAM{"comment_city"}% | %TMPL:END%See rendered template table
%TMPL:DEF{PROMPT:toctalk}% %TABLE{databg="#ffffff" tableborder="0" cellborder="0"}% | <label for="comment_summary">Summary</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_summary" id="comment_summary" /> | | <label for="toctalk_comment_text">Message</label>| <textarea %DISABLED% rows="%rows|3%" cols="%cols|50%" name="toctalk_comment_text" id="toctalk_comment_text" class="twikiInputField" wrap="soft" onfocus="if(this.value=='%MESSAGE%')this.value=''" onblur="if(this.value=='')this.value='%MESSAGE%'">%MESSAGE%</textarea> | || <input %DISABLED% type="submit" value="%button|Add%" class="twikiButton" /> | %TMPL:END%
%TMPL:DEF{OUTPUT:toctalk}% %POS:BEFORE%---++++ %SERVERTIME% %WIKIUSERNAME%: %URLPARAM{"comment_summary"}% %POS:BEFORE%%URLPARAM{"toctalk_comment_text" }% %POS:BEFORE% %TMPL:END%See rendered template toctalk
%TMPL:DEF{PROMPT:bookmark}% %TABLE{databg="#ffffff" tableborder="0" cellborder="0"}% | <label for="comment_url">Url</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_url" id="comment_url" value="http://" /> | | <label for="comment_link">Link label</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_link" id="comment_link" /> | | <label for="bookmark_comment_text">Comment</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="bookmark_comment_text" id="bookmark_comment_text" value="%MESSAGE%" /> | || <input %DISABLED% type="submit" value="%button|Add bookmark%" class="twikiButton" /> | %TMPL:END%
%TMPL:DEF{OUTPUT:bookmark}%%POS:BEFORE% * [[%URLPARAM{"comment_url" encode="entity"}%][%URLPARAM{"comment_link" encode="entity"}%]] %IF{" '%URLPARAM{"bookmark_comment_text" encode="entity"}%' = '' " then="" else="- "}%%URLPARAM{"bookmark_comment_text" encode="entity"}% %TMPL:END%See rendered template bookmark
target
is set in the PROMPT
. In the form below the redirectto
is set to the current (including) topic. Available with TWiki 4.1.
%TMPL:DEF{returnpromptbox}% <input type="hidden" name="redirectto" value="%BASEWEB%.%BASETOPIC%" /> %TMPL:P{promptbox}% %TMPL:END%
%TMPL:DEF{PROMPT:return}%%TMPL:P{returnpromptbox}%%TMPL:END%
%TMPL:DEF{OUTPUT:return}%%POS:BEFORE%%TMPL:P{OUTPUT:threadmode}%%TMPL:END%See rendered template return
[More topic actions]
(bottom right of page) on the topic to be changed, then, in the new screen, on [Copy topic]
. You can now copy in one operation
DISABLEFIXLINKCHECKBOX
preference variable is 'on'
. Checking this checbox makes the copying operation bypass fixing WikiWord links in the copy destination topic if copy is done across webs
[Copy]
: the topic will be copied.
DISABLEFIXLINKSCHECKBOX
needs to be set 'on'
for the checkbox to show up.
VIEW
access to that topic.
In addition, you need CHANGE
access to the destination topic.
If the destination topic already exists and hence is overwritten, RENAME
access to the destination is also needed so that it can be deleted before copying.
See TWikiAccessControl for information on setting up access permissions.
Related Topics: UserDocumentationCategory, AdminDocumentationCategory$ENV{REMOTE_USER}
from a mechanismm provided by the environment.
A user can be represented as USER:user-id
in addition to a wikiname.
USER:user-id
in a topic becomes a hyper link to the directory look-up page of the user.
LDAPGROUP:group-name
.
There is no wikiname corresponding to those groups.
LDAPGROUP:group-name
in a topic becomes a hyper link to the directory look-up page of the group.
LDAP groups may be used in parallel to group defined by TWiki topics.
* Set ALLOWWEBVIEW = LDAPGROUP:team-foo, USER:barFor change notification (in WebNotify topics), the notatons are used as follows.
* 'LDAPGROUP:team-foo' * 'USER:bar'This is inconvenient because you need to put quotes for change notification, but you don't need to for access control. But you can configure change notification so that you don't need to put quotes for the notations.
$TWiki::cfg{UserMappingManager}
accordingly.
handlesUser()
login2cUID()
getLoginName()
getWikiName()
findUserByEmail()
getEmails()
findUserByWikiName()
$TWiki::cfg{PasswordManager}
is set to 'none'
.
Recognized as a login name |
Recognized as a wikiname |
|
---|---|---|
USER:user-id |
must be | must be |
LDAPGROUP:group-name |
must not be | must be |
USER:user-id
is given.
LDAPGROUP:group-name
is handed, the method needs to return the list whose only element is the one handed.
Otherwise, expand the group.
LDAPGROUP:group-name
needs to yield true.
LDAPGROUP:group-name
needs to be taken care of.
LDAPGROUP:group-name
is handed, the method needs to return the email address corresponding to the LDAP group.
USER:user-id
is handed, the method needs to return the corresponding cUID.
Related Topics: AdminDocumentationCategory, TWikiAccessControl, MailerContribdate
type to TWikiForms:
Type | Description | Size | Value |
---|---|---|---|
date |
Text input field and a button next to it to pick a date from a pop-up calendar. The date can also be typed into the text box. | Text box width in number of characters | Initial (default) date |
Name: | Type: | Size | Values: | Tooltip message: |
---|---|---|---|---|
Start date | date | 12 | 2024-09-21 | Select start date |
<form action="..."> %DATEPICKER{ name="Start_date" value="2024-09-21" }% <form>This will show an HTML input field named "Start_date" and a button to popup a calendar to select a date.
Parameter | Description | Default | Example |
---|---|---|---|
name |
Name of input field. φ: No output is shown if the name parameter is missing, but the CSS and Javascript are loaded. |
(requiredφ) | name="Start" |
value |
Initial date value. | "" (today) |
value="2012-12-31" |
format |
Format of resulting date value. • %a - abbreviated weekday name• %A - full weekday name• %b - abbreviated month name• %B - full month name• %C - century number• %d - the day of the month (00 ... 31)• %e - the day of the month (0 ... 31)• %H - hour (00 ... 23)• %I - hour (01 ... 12)• %j - day of the year ( 000 ... 366)• %k - hour (0 ... 23)• %l - hour (1 ... 12)• %m - month (01 ... 12)• %M - minute (00 ... 59)• %n - a newline character• %p - "PM" or "AM"• %P - "pm" or "am"• %S - second (00 ... 59)• %s - number of seconds since Epoch (since Jan 01 1970 00:00:00 UTC)• %t - a tab character• %U , %W , %V - the week number. The week 01 is the week that has the Thursday in the current year, which is equivalent to the week that contains the fourth day of January. Weeks start on Monday.• %u - the day of the week (1 ... 7, 1 = MON)• %w - the day of the week (0 ... 6, 0 = SUN)• %y - year without the century (00 ... 99)• %Y - year including the century (ex. 2012)• %% - a literal % character |
"%Y-%m-%d" |
format="%e %b %Y" |
id |
ID of input field, optional. | "id_" + name |
id="idStart" |
size |
Size of input field, in number of characters. | (calculated as needed) | size="12" |
class |
CSS class of input field. | "twikiInputField" |
class="dateField" |
Additional HTML input field attributes, such as alt , disabled , maxlength , onblur , onchange , onfocus , readonly , style , tabindex , title |
TWiki::Plugins::DatePickerPlugin::renderForEdit( $name, $value, $format [, \%options] ) -> $html
This is the simplest way to use calendars from a plugin. $name
is the name of the CGI parameter for the calendar (it should be unique),
$value
is the current value of the parameter (may be undef)
$format
is the format to use (optional; the default is set in configure
). The HTML returned will display a date field and a drop-down calendar.
\%options
is an optional hash containing base options for the textfield.
addToHEAD()
function does not need to be called.
$name
is empty or undef, but the CSS and Javascript are loaded if needed. This can be used to preload the CSS and Javascript with a parameterless %DATEPICKER{}%
variable.
use TWiki::Plugins::DatePickerPlugin; ... my $fromDate = TWiki::Plugins::DatePickerPlugin::renderForEdit( 'from', '2012-12-31'); my $toDate = TWiki::Plugins::DatePickerPlugin::renderForEdit( 'to', undef, '%Y');
TWiki::Plugins::DatePickerPlugin::addToHEAD( $setup )
This function will automatically add the headers for the calendar to the page
being rendered. It's intended for use when you want more control over the
formatting of your calendars than renderForEdit
affords. $setup
is the name
of the calendar setup module; it can either be omitted, in which case the method
described in the Mishoo documentation can be used to create calendars, or it
can be 'twiki'
, in which case a Javascript helper function called
'showCalendar' is added that simplifies using calendars to set a value in a
text field. For example, say we wanted to display the date with the calendar
icon before the text field, using the format %Y %b %e
use TWiki::Plugins::DatePickerPlugin; ... sub commonTagsHandler { .... # Add styles and javascript for the date picker & enable 'showCalendar' TWiki::Plugins::DatePickerPlugin::addToHEAD( 'twiki' ); my $cal = CGI::image_button( -name => 'img_datefield', -onclick => "return showCalendar('id_datefield','%Y %b %e')", -src=> TWiki::Func::getPubUrlPath() . '/' . TWiki::Func::getTwikiWebname() . '/DatePickerPlugin/img.gif', -alt => 'Calendar', -align => 'middle' ) . CGI::textfield( { name => 'date', id => "id_datefield" }); .... }The first parameter to
showCalendar
is the id of the textfield, and the
second parameter is the date format. Default format is '%Y-%m-%d'
.
The addToHEAD
function can be called from commonTagsHandler
for adding
the header to all pages, or from beforeEditHandler
just for edit pages etc.
DatePickerPlugin.zip
in your twiki installation directory.
{Plugins}{DatePickerPlugin}
settings in the "Extensions" section of configure: Setting | Default |
---|---|
$TWiki::cfg{Plugins}{DatePickerPlugin}{Format} | '%Y-%m-%d' |
$TWiki::cfg{Plugins}{DatePickerPlugin}{Lang} | 'en' |
$TWiki::cfg{Plugins}{DatePickerPlugin}{Style} | 'twiki' |
Author: | TWiki:Main.PeterThoeny, TWiki.org |
Copyright: | © See the Mishoo documentation for Mishoo JSCalendar; © 2012 Wave Systems Corp. for TWiki DatePickerPlugin rewrite; © 2004-2018 TWiki:Main.PeterThoeny for TWiki DatePickerPlugin; © 2004-2018 TWiki:TWiki.TWikiContributor for TWiki DatePickerPlugin |
Sponsor: | Wave Systems Corp. |
License: | GPL (GNU General Public License) |
Dependencies: | JQueryPlugin (pre-installed) |
Version: | 2018-07-05 |
Change History: | |
2018-07-05: | TWikibug:Item7841: Copyright update to 2018 |
2016-01-08: | TWikibug:Item7708: Copyright update to 2016 |
2015-01-10: | TWikibug:Item7604: Switch to GPL v3 |
2014-12-11: | TWikibug:Item7577: TWiki form field type with configure attributes -- TWiki:Main.PeterThoeny |
2013-09-04: | TWikibug:Item7333: Support more input field attributes, such as accesskey, pattern and required -- TWiki:Main.PeterThoeny |
2013-01-09: | TWikibug:Item7091: Use TWISTY in detailed documentation section, installation instructions -- TWiki:Main.PeterThoeny |
2012-12-20: | TWikibug:Item7077: Initial version, partly based on work of TWiki:Plugins.JSCalendarContrib -- TWiki:Main.PeterThoeny |
Home: | http://TWiki.org/cgi-bin/view/Plugins/DatePickerPlugin |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/DatePickerPluginDev |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/DatePickerPluginAppraisal |
Trash
web, where it's hidden but can be "undeleted" with system administrator access.
Click [More topic actions]
on the control bar at the bottom of the page you want to change, then choose [Rename/move topic]
, and make your changes to that screen. There's a link that launches to the ManagingTopics reference page in a pop-up window.
NOTE: The configuration of your site and your own access permissions determine whether you can access these functions.
Note for site administrators: To remove a topic permanently move it to the Trash web, then with file-level access, delete the .txt
and .txt,v
files manually from /twiki/data/Trash
.
Back to: TWikiFAQ
Related Topics: UserDocumentationCategoryTrashAttachment
topic in the Trash
web, where it's hidden but can be "undeleted" with system administrator access. Please note that you cannot rename an attachment in the current TWiki release.
Click on [action]
on the file in the FileAttachment table, then in the Update attachment screen choose [Move attachment]
, and make your changes to that screen.
NOTE: The configuration of your site and your own access permissions determine whether you can access these functions.
Note for system administrators: To remove an attachment permanently move it to the Trash.TrashAttachment topic, then with file-level access, delete the file attachment and its ,v
repository file manually from twiki/pub/Trash/TrashAttachment
.
Back to: TWikiFAQ
Related Topics: UserDocumentationCategoryDONTNOTIFYCHECKBOX
preferences variable. See TWikiPreferences for more.
Related Topics: UserDocumentationCategory[Save]
button.
Note that a new revision is created if another person edits the same topic, regardless of the time.
TWiki administrators can modify the time frame with the {ReplaceIfEditedAgainWithin}
configure setting.
Back to: TWikiFAQ
Related Topics: UserDocumentationCategory%EDITTABLE{}%
directly above the table. This can be added to tables that are formatted with TablePlugin: add the EDITTABLE
variable just above or below the TABLE
tag. It can also be used without any TABLE
tag.
Customize entry fields by specifying the format: use a text field, a drop down box, a date field, radio buttons or checkboxes.
Multiple tables per topic are editable, but only one at a time can be edited.
ATTENTION: This plugin version depends on the new TWiki:Plugins.DatePickerPlugin; the JSCalendarContrib is no longer needed and must be upgraded or uninstalled. Before uninstalling JSCalendarContrib check if you use any extensions that depend on the JSCalendarContrib as described in that contrib package.
%EDITTABLE{...}%
variable just before an existing table to make it editable, or add the variable anywhere in a topic to start a new table.
Attribute | Comment | Default |
---|---|---|
header | Specify the header format of a new table like "|*Food*|*Drink*|" . Useful to start a table with only a button | (no header) |
format | The format of one column when editing the table. A cell can be a text input field, or any of these edit field types: • Text input field (1 line): | text, <size>, <initial value> | • Textarea input field: | textarea, <rows>x<columns>, <initial value> | • Drop down box: | select, <size>, <option 1>, <option 2>, etc* | * only one item can be selected • Radio buttons: | radio, <size*>, <option 1>, <option 2>, etc | * size indicates the number of buttons per line in edit mode • Checkboxes: | checkbox, <size*>, <option 1>, <option 2>, etc | * size indicates the number of checkboxes per line in edit mode • Fixed label: | label, 0, <label text> | • Row number: | row, <offset> | • Date: | date, <size>, <initial value>, <DHTML date format*> | * see Date Field Type | "text, 16" for all cells |
changerows | Rows can be added and removed if "on" Rows can be added but not removed if "add" Rows cannot be added or removed if "off" | CHANGEROWS plugin setting |
quietsave | Quiet Save button is shown if "on" , hidden if "off" | QUIETSAVE plugin setting |
include | Other topic defining the EDITTABLE parameters. The first %EDITTABLE% in the topic is used. This is useful if you have many topics with the same table format and you want to update the format in one place. | (none) |
helptopic | Topic name containing help text shown below the table when editing a table. The %STARTINCLUDE% and %STOPINCLUDE% variables can be used in the topic to specify what is shown. | (no help text) |
headerislabel | Table header cells are read-only (labels) if "on" ; header cells can be edited if "off" or "0" | "on" |
editbutton | Set edit button text, e.g. "Edit this table" ; set button image with alt text, e.g. "Edit table, %PUBURL%/%SYSTEMWEB%/TWikiDocGraphics/edittopic.gif" ; hide edit button at the end of the table with "hide" (Note: Button is automatically hidden if an edit button is present in a cell) | EDITBUTTON plugin setting |
buttonrow | Set to top to put the edit buttons above the table. | bottom |
javascriptinterface | Use javascript to directly move and delete row without page refresh. Enable with "on" , disable with "off" . | JAVASCRIPTINTERFACE plugin setting |
redirectto | Set up a return page after saving changes. e.g By setting redirectto="%BASEPAGE%", you can return to base page if your editable table is included by another page. | (none) |
<initial value>
(of text input field) and <label text>
(of fixed label) get expanded when a new row is added. This can be used for example to add a timestamp to a label. You can escape characters with format tokens if you do not want that.
Any TWiki variable inside a table cell will be preserved. For instance, %TOPIC%
will not get expanded to the current topic name.
The format tokens are the same as with FormattedSearch:
Escape: | Expands To: |
---|---|
$n or $n() |
New line. Use $n() if followed by alphanumeric character, e.g. write Foo$n()Bar instead of Foo$nBar |
$nop or $nop() |
Is a "no operation". |
$quot |
Double quote (" ) |
$percnt |
Percent sign (% ) |
$dollar |
Dollar sign ($ ) |
date
field type allows one to choose a date with a popup calendar. Popup calendar works with all modern browsers. The date picker button is inactive if the browser cannot support the popup calendar or if Javascript is disabled.
The date format can be defined; the default is taken from the {Plugins}{DatePickerPlugin}{Format}
configure setting. Date specifiers are described in DatePickerPlugin. Example format for ISO date: format="| date, 10, , %Y-%m-%d |"
.
%EDITCELL{ "type, ..." }%
variable at the end of the cell content. This is useful to override the per column %EDITTABLE{ format="..." }%
settings, or to create tables with key/value rows. All edit field types of the format="..."
parameter are supported. For example, to define a text field, type: | cell content %EDITCELL{ "text, 20" }% |
It is also possible to place the edit button inside a cell instead of default location below the table. Type | %EDITCELL{ "editbutton, 1, Edit this table" }% |
to show a button, or | %EDITCELL{ "editbutton, 1, Edit table, Image-URL" }% |
to show a button image with alternate text.
Note: The %EDITCELL{ }%=variable cannot be used by itself; place an =%EDITTABLE{ }%=variable at the beginning of a table where you want to use =%EDITCELL{ }%
variables.
%EDITTABLE{ format="| row, -1 | text, 20, init | select, 1, one, two, three, four | radio, 3,:-),:-I,:-( | label, 0, %SERVERTIME{"$day $mon $year $hour:$min"}% |" changerows="on" }%
Nr | Text field | Drop down | Mood | Timestamp |
---|---|---|---|---|
1 | 26 Jun 2002 12:30 | |||
2 | 27 Jun 2002 12:40 |
You type: | You get: | Table in edit mode: |
---|---|---|
%TABLE{"headerrows="1"}% %EDITTABLE{ format="| label | text, 40 |" changerows="off" }% |*Key*|*Value*| | Name: | John Smith | | Gender: | M %EDITCELL{select, 1, , F, M}% | | DOB: | 1999/12/31 %EDITCELL{date, 10}% | | City: | New York | |
| ... ||
) and cell justification (e.g. | centered | right |
)
%EDITTABLE{}%
statements on the same line in the source
select,1,%<nop>X%,%<nop>Y%
%<plugin>_<setting>%
, for example, %EDITTABLEPLUGIN_SHORTDESCRIPTION%
data/debug.txt
. Default: 0
javascriptinterface
. on
, off
, add
on
to show the Quiet Save button, off
to hide button text
, or specify alternate text, image URL
. Note: Texts inside %MAKETEXT{}%
are translated into other languages. EditTablePlugin.zip
in your ($TWIKI_ROOT) directory.
Name | Version | Description |
---|---|---|
TWiki::Plugins::DatePickerPlugin | >=0 | Required. Used to select a date when using type date. |
viewauth
script to authenticate the user. As described in TWikiAccessControl, copy the view
script to viewauth
(or better, create a symbolic link) and add viewauth
to the list of authenticated scripts in the .htaccess
file.
configure
in your TWiki installation, and enable the plugin in the {Plugins} section.
Plugin Author: | Arthur Clemens, TWiki:Main.PeterThoeny |
Copyright: | © 2008 Arthur Clemens; © 2002-2018 TWiki:Main.PeterThoeny, TWiki.org; © 2002-2018 TWiki:TWiki.TWikiContributor |
License: | GPL (GNU General Public License) |
Plugin Version: | 2018-07-05 |
2018-07-05: | TWikibug:Item7841: Copyright update to 2018 |
2016-11-14: | TWikibug:Item7759: using viewauth unnecessarily, bringing down TWiki if headerrows and footerrows are inapprropriate -- TWiki:HideyoImazu |
2016-01-08: | TWikibug:Item7708: Copyright update to 2016 |
2015-01-10: | TWikibug:Item7604: Switch to GPL v3 |
2013-12-03: | TWikibug:Item7394: EditTablePlugin is not showing space characters correctly in date fields. -- TWiki:Main.YaojunFei |
2013-12-01: | TWikibug:Item7392: EditTablePlugin executes "ASSERT(0) if DEBUG;" statement when clicking on "canel" button. -- TWiki:Main.YaojunFei |
2013-11-12: | TWikibug:Item7379: Clicking an edit table button and then saving it may add a blank row -- TWiki:Main.YaojunFei |
2013-11-05: | TWikibug:Item7377: EditTablePlugin may eat table rows -- TWiki:Main.YaojunFei |
2013-10-18: | TWikibug:Item7373: EDITTABLE can't handle HTML comments in table cells -- TWiki:Main.PeterThoeny |
2013-01-13: | TWikibug:Item7091: Use TWISTY in plugin settings section, installation instructions and change history -- TWiki:Main.PeterThoeny |
2012-12-12: | TWikibug:Item7077: Make EditTablePlugin dependent on DatePickerPlugin instead of deprecated JSCalendarContrib -- TWiki:Main.PeterThoeny |
2012-11-12: | TWikibug:Item7020: Categorize TWiki Variable EDITTABLE -- TWiki:Main.PeterThoeny |
2012-11-06: | TWikibug:Item7025: Return to base page after saving changes. |
2012-11-06: | TWikibug:Item7024: Make EditTable read-only when current site mode is readonly or slave |
2012-07-11: | TWikibug:Item6900: Fix for warning: "my" variable %regex masks earlier declaration -- TWiki:Main.JudBarron |
2011-07-07: | TWikibug:Item6725: Change global package variables from "use vars" to "our" |
2010-05-25: | 5.1: TWikibug:Item6324 - Fix for editing a table removing EDITCELL from another table - patch by TWiki:Main/NickThorpe |
2010-05-16: | 5.0: TWikibug:Item6433 - doc improvements; replacing TWIKIWEB with SYSTEMWEB |
17 Apr 2009: | 4.9.1: Save of table can only be done with http POST method, not GET |
01 Nov 2008: | 4.9: Arthur Clemens: Fixed rendering of verbatim blocks when editing. Added parameter buttonrow="top" to allow the buttons to be positioned at the top of the table. |
26 Sep 2008: | 4.8.7: Arthur Clemens: Let empty table initialize more than one column from header parameter |
24 Sep 2008: | 4.8.6: Arthur Clemens: Fix parsing of header labels |
21 Sep 2008: | 4.8.5: Arthur Clemens: Fix rendering of TML inside label |
03 Aug 2008: | 4.8.4: TWiki 4.2.1 release version |
19 Jul 2008: | 4.8.3: Bugfix release |
20 Mar 2008: | 4.8: Arthur Clemens: Code refactoring; disabled table sort when editing; removed usage of $percnt to prevent variable expansion (is now done automatically); made Javascript interface aware of headers and footers, and of changerows="off" ; improved feedback on row move. |
25 Dec 2007: | 4.7.1: Arthur Clemens: Added warning if include parameter topic does not exist. |
22 Dec 2007: | 4.7: Arthur Clemens: Changed handling of escaped variables. To escape TWiki variable, use formatting tokens such as $percnt . |
16 Dec 2007: | 4.6: Kenneth Lavrsen: The plugin prevents TablePlugin from initsorting the table being edited. This is done by temporarily appending the attribute disableallsort="on" to the TABLE tag of a table being edited. Additionally all header sorting is disabled while editing a table by setting a hidden formfield sort to "off". Disabling sorting while editing is needed now that the EditTablePlugin supports moving rows up and down. |
01 Dec 2007: | 4.3: Arthur Clemens: added support for TablePlugin headerrows and footerrows ; updated edit button |
16 Oct 2007: | 4.2: Arthur Clemens: refactoring, bug fixes. |
07 Oct 2007: | 15182: PTh: Added VarEDITTABLE to have it listed in TWikiVariables |
15 Mar 2007: | Arthur Clemens: Fixed eating of double newlines; icons for Javascript buttons and interface improvements. By default the Javascript interface is turned off, set JAVASCRIPTINTERFACE to use it in edit mode. |
05 Mar 2007: | Byron Darrah: Added ability to dynamically move and delete rows. |
12 Oct 2006: | Item2982 Use default date format from JSCalendarContrib |
02 Oct 2006: | Item2884 Check also for access permission in meta data; proper fix to not warn if oneself has a lock on topic |
30 Aug 2006: | Item2829 Remove whitespace from select, radio and checkbox items; restored topic lock if $TWiki::Plugins::VERSION < 1.1 |
29 Jul 2006: | Item2684 - Quietly ignore topic edit locks on table edit |
21 Jan 2006: | TWiki:Main.CrawfordCurrie ported to TWiki-4.0.0, changed to use JSCalendarContrib |
16 Sep 2004: | Added radio buttons and checkbox controls; escaped "|" pipe symbol found in input fields to preserve tables |
01 Aug 2004: | Fixed bug where edittable did not work if at the end of a topic |
07 Apr 2004: | Fixed bug where two tables got updated when you edit and save a table included into a topic containing other edit tables |
02 Mar 2004: | Default for %EDITCELL{editbutton}% is EDITBUTTON preference |
27 Feb 2004: | Added QUIETSAVE setting and quietsave parameter; image for Edit button |
18 Feb 2004: | Doc fixes; allow edit button anywhere in a cell not just at the end of a cell |
17 Feb 2004: | Added per cell definition of edit field types with %EDITCELL{}% variable; added headerislabel and editbutton parameters |
20 Dec 2003: | Fixed bug where calendar did not work after adding a row (TWiki:Main/PaulineCheung); added all language files of Mishoo DHTML calendar 0.9.5 |
13 Dec 2003: | Added CHANGEROWS, JSCALENDARDATEFORMAT, JSCALENDARLANGUAGE, JSCALENDAROPTIONS settings |
16 Oct 2003: | small typo fixed (garbled if ---+ header on top) |
15 Oct 2003: | new date field type with Javascript calendar - CN |
14 Oct 2003: | docfix: the documentation page was an old one - CN |
13 Oct 2003: | bugfix: %-vars in select were resetted to first on add/del row - CN |
18 Sep 2003: | incompatibility: changed default of changerows to on ; support for %-vars, Quiet save for saving without notification; all other fixes in Dev topic integrated - CN |
08 Nov 2002: | Prevent variable expansion in label text; added escape characters |
27 Jun 2002: | New helptopic parameter |
26 Jun 2002: | Support for variables in included EDITTABLE parameters; fixed problem with HTML in cells |
21 May 2002: | Added fixed label format; new changerows="add" parameter |
27 Apr 2002: | Fixed bug where text after a double quote in a cell disappeared |
18 Apr 2002: | Fixed bug where table was breaking when pasting multiple lines into an edit field using Netscape on Unix |
08 Apr 2002: | Check for change permission and edit lock of topic |
05 Apr 2002: | Initial version |
Dependencies: |
|
||||||
Perl Version: | 5.0 | ||||||
TWiki:Plugins/Benchmark: | GoodStyle 98%, FormattedSearch 98%, EditTablePlugin 95% | ||||||
Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/EditTablePlugin | ||||||
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/EditTablePluginDev | ||||||
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/EditTablePluginAppraisal |
lib/TWiki/Plugins/EmptyPlugin.pm
to <name>Plugin.pm
and customize the plugin. Add your own code; remove all handlers you do not plan to use.
<name>Plugin
documentation topic in the TWiki web. Do so by visiting http://twiki.org/cgi-bin/view/Plugins/PluginPackageHowTo and starting a new topic to get the default plugin topic text (don't save the topic on twiki.org yet). Customize your plugin topic to your needs.
%EXAMPLEVAR{"..."}%
Parameter | Explanation | Default |
---|---|---|
"..." |
Default parameter. | (none) |
format="..." |
Format: ... | "$name" |
%EXAMPLEVAR{}%
expands to: %EXAMPLEVAR{}%
EmptyPlugin.zip
in your twiki installation directory. Content: File: | Description: |
---|---|
data/TWiki/EmptyPlugin.txt | Plugin topic |
data/TWiki/VarEXAMPLEVAR.txt | Variable documentation topic |
lib/TWiki/Plugins/EmptyPlugin.pm | Plugin Perl module |
lib/TWiki/Plugins/EmptyPlugin/Config.spec | Plugin Config spec |
Plugin Author: | TWiki:Main.AndreaSterbini, TWiki:Main.PeterThoeny, TWiki:Main.CrawfordCurrie |
Copyright: | © 2001-2018 TWiki:Main.PeterThoeny, TWiki.org; © 2001-2018 TWiki:TWiki.TWikiContributor |
License: | GPL (GNU General Public License) |
Plugin Version: | 2018-05-07 |
2018-07-05: | TWikibug:Item7841: Copyright update to 2018 |
2016-01-08: | TWikibug:Item7708: Copyright update to 2016 |
2015-09-18: | TWikibug:Item7689: Introducing topicTitleHandler() in plugins |
2015-07-02: | TWikibug:Item7604: Fix source code comment about parameters of TWiki variables |
2015-01-10: | TWikibug:Item7604: Switch from GPL v2 to v3 |
2013-09-27: | TWikibug:Item7354: Align TWiki::Plugins::VERSION with TWiki release version, e.g. 6.00 for TWiki-6.0.0 |
2013-02-16: | TWikibug:Item7123: Use TWISTY in installation instructions and change history |
2013-02-11: | TWikibug:Item7142: iewRedirectHandler() in plug-ins -- TWiki:Main.HideyoImazu |
2012-12-12: | TWikibug:Item7077: Small doc fix -- TWiki:Main.PeterThoeny |
2012-11-15: | TWikibug:Item7020: Add category to VarEXAMPLEVAR variable doc -- TWiki:Main.PeterThoeny |
2011-05-22: | TWikibug:Item6724: Pass text and meta data to registerTagHandler callback -- TWiki:Main.PeterThoeny |
2011-05-17: | TWikibug:Item6725: Change global package variables from "use vars" to "ours"; doc improvements -- TWiki:Main.PeterThoeny |
2011-03-06: | TWikibug:Item6656: Add meta data to attachment save handlers |
2011-02-08: | TWikibug:Item6593: Doc improvements; adding VarEXAMPLEVAR variable documentation |
2010-05-08: | TWikibug:Item6433: Doc improvements; replacing TWIKIWEB with SYSTEMWEB |
2007-05-20: | Added renderWikiWordHandler |
2006-02-01: | Dakar changes |
2004-03-21: | Added afterSaveHandler |
2001-07-14: | Changed to plug&play |
2001-02-27: | Initial version |
TWiki Dependency: | $TWiki::Plugins::VERSION 1.4 |
Dependencies: | %$DEPENDENCIES |
Plugin Benchmark: | GoodStyle 99%, FormattedSearch 99%, EmptyPlugin 99% |
Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/EmptyPlugin |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/EmptyPluginDev |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/EmptyPluginAppraisal |
Attach
link at the bottom of the page. The Attach
screen lets you browse for a file, add a comment, and upload it. The uploaded file will show up in the File Attachment table. *.php
files are renamed to *.php.txt
so that no one can place code that would be read in a .php file.
%ATTACHFILESIZELIMIT%
variable of the TWikiPreferences, currently set at 60000 KB. Manage
on the Attachment to be moved.
Move
. The attachment and its version history are moved. The original location is stored as topic Meta Data.
Trash
, topic TrashAttachment
.
Attach
file: Sample.txt
Edit
topic and enter: %ATTACHURL%/Sample.txt
Preview
: %ATTACHURL%/Sample.txt
text appears as: /pub/TWiki/FileAttachment/Sample.txt, a link to the text file.
%PUBURLPATH%/%WEB%/OtherTopic/Sample.txt
(if it's within the same web)
%PUBURLPATH%/Otherweb/OtherTopic/Sample.txt
(if it's in a different web)
Attach
file: Sample.txt
Edit
topic and write text: %INCLUDE{"%ATTACHURL%/Sample.txt"}%
Attach
file: Smile.gif
Edit
topic and write text: %ATTACHURL%/Smile.gif
Preview
: text appears as /pub/TWiki/FileAttachment/Smile.gif, an image.
I | Attachment | History | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|---|
txt | Sample.txt | manage | 0.1 K | 2000-07-22 - 19:37 | TWikiContributor | Just a sample | |
gif | Smile.gif | manage | 0.1 K | 2000-07-22 - 19:38 | TWikiContributor | Smiley face |
Manage
link takes you to a new page that looks a bit like this (depending on what skin is selected):
Sample.txt
(UploadingUser)h
means the attachment is hidden, it isn't listed when viewing a topic.
Hide file
checkbox, then click Change properties
.
.txt
extension is appended to some filenames for security reasons
~
, $
, @
, %
are removed
{ReplaceIfEditedAgainWithin}
), TWiki will fold together your changes. This is often the "right thing to do", as it can reduce the visual clutter of the topic history.
The "Force new revision" checkbox is a way to force it to create a separate revision each time you save.
The TWiki.TWikiPreferences variable FORCENEWREVISIONCHECKBOX
controls whether this is checked by default or not.
On a related note, you can force every save to be a new revision number by setting {ReplaceIfEditedAgainWithin}
to 0
.
Related Topics: UserDocumentationCategory, AdminDocumentationCategory $n or $n() |
New line. Use $n() if followed by alphanumeric character, e.g. write Foo$n()Bar instead of Foo$nBar |
$nop or $nop() |
Is a "no operation". This variable gets removed; useful for nested search |
$quot or \" |
Double quote (" ) |
$aquot |
Apostrophe quote (' ) |
$percnt |
Percent sign (% ) |
$dollar |
Dollar sign ($ ) |
$lt |
Less than sign (< ) |
$gt |
Greater than sign (> ) |
$dollar
to escape the leading dollar, thus: $dollarpercnt
.
Related topics: FormattedSearch, IfStatements, QuerySearch, TWikiForms%SEARCH{...}%
is a table consisting of topic names and topic summaries. Use the format="..."
parameter to customize the search result. The format parameter typically defines a bullet or a table row containing variables, such as %SEARCH{ "food" format="| $topic | $summary |" }%
. See %SEARCH{...}%
for other search parameters, such as separator=""
.
header="..."
parameter header="| *Topic:* | *Summary:* |"
Variables that can be used in the header string:
Name: | Expands To: |
---|---|
$web |
Name of the web |
$n or $n() |
New line. Use $n() if followed by alphanumeric character, e.g. write Foo$n()Bar instead of Foo$nBar |
$nop or $nop() |
Is a "no operation". This variable gets removed; useful for nested search |
$quot or \" |
Double quote (" ) |
$aquot |
Apostrophe quote (' ) |
$percnt |
Percent sign (% ) |
$dollar |
Dollar sign ($ ) |
$lt |
Less than sign (< ) |
$gt |
Greater than sign (> ) |
format="..."
parameter format="| $topic | $summary |"
Variables that can be used in the format string:
Name: | Expands To: |
---|---|
$web |
Name of the web |
$topic |
Topic name |
$topic(20) |
Topic name, "- " hyphenated each 20 characters |
$topic(30, -<br />) |
Topic name, hyphenated each 30 characters with separator "-<br />" |
$topic(40, ...) |
Topic name, shortened to 40 characters with "..." indication |
$topictitle |
Topic title, in order of sequence defined by: Form field named "Title", topic preference setting named TITLE, topic name |
$parent |
Name of parent topic; empty if not set |
$parent(20) |
Name of parent topic, same hyphenation/shortening like $topic() |
$text |
Formatted topic text. In case of a multiple="on" search, it is the line found for each search hit. |
$text(encode:type) |
Same as above, but encoded in the specified type. Possible types are the same as in ENCODE. Though ENCODE can take the extra parameter, $text(encode:type) cannot. Example: $text(encode:html) |
$locked |
LOCKED flag (if any) |
$date |
Time stamp of last topic update, e.g. 2024-09-21 - 01:30 |
$isodate |
Time stamp of last topic update, e.g. 2024-09-21T01:30Z |
$rev |
Number of last topic revision, e.g. 4 |
$username |
Login name of last topic update, e.g. jsmith |
$wikiname |
Wiki user name of last topic update, e.g. JohnSmith |
$wikiusername |
Wiki user name of last topic update, like Main.JohnSmith |
$createdate |
Time stamp of topic revision 1 |
$createusername |
Login name of topic revision 1, e.g. jsmith |
$createwikiname |
Wiki user name of topic revision 1, e.g. JohnSmith |
$createwikiusername |
Wiki user name of topic revision 1, e.g. Main.JohnSmith |
$summary |
Topic summary, just the plain text, all TWiki variables, formatting and line breaks removed; up to 162 characters |
$summary(50) |
Topic summary, up to 50 characters shown |
$summary(showvarnames) |
Topic summary, with %ALLTWIKI{...}% variables shown as ALLTWIKI{...} |
$summary(expandvar) |
Topic summary, with %ALLTWIKI{...}% variables expanded |
$summary(noheader) |
Topic summary, with leading ---+ headers removedNote: The tokens can be combined, for example $summary(100, showvarnames, noheader) |
$changes |
Summary of changes between latest rev and previous rev |
$changes(n) |
Summary of changes between latest rev and rev n |
$formname |
The name of the form attached to the topic; empty if none |
$formfield(name) |
The field value of a form field; for example, $formfield(TopicClassification) would get expanded to PublicFAQ . This applies only to topics that have a TWikiForm |
$formfield(name, encode:type) |
Form field value, encoded in the specified type. Possible types are the same as in ENCODE: quote , moderate , safe , entity , html , url and csv . The encode:type parameter can be combined with other parameters described below, but it needs to be the last parameter. Example: $formfield(Description, 20, encode:html) |
$formfield(name, render:display) |
Form field value, rendered for display. For example, a form field of type color will render as a colored box. If not specified, the raw value is returned, such as a color value #336699 . The render:display parameter can be combined with other parameters, but must be used after the parameters described below. |
$formfield(name, 10) |
Form field value, "- " hyphenated each 10 characters |
$formfield(name, 20, -<br />) |
Form field value, hyphenated each 20 characters with separator "-<br />" |
$formfield(name, 30, ...) |
Form field value, shortened to 30 characters with "..." indication |
$query(query-syntax) |
Access topic meta data using SQL-like QuerySearch syntax. Example: • $query(attachments.arraysize) returns the number of files attached to the current topic • $query(attachments[name~'*.gif'].size) returns an array with size of all .gif attachments, such as 848, 1425, 923 • $query(parent.name) is equivalent to $parent |
$query(query-syntax, quote:") |
Strings in QuerySearch result are quoted with the specified quote. Useful to triple-quote strings for use in SpreadSheetPlugin's CALCULATE, such as $query(attachments.comment, quote:''') which returns a list of triple-quoted attachment comment strings -- the spreadhseet funcions will work properly even if comment strings contain commas and parenthesis |
$query(query-syntax, encode:type) |
QuerySearch result is encoded in the specified type. This is in parallel to $formfield(name, encode:type) mentioned above |
$pattern(reg-exp) |
A regular expression pattern to extract some text from a topic (does not search meta data; use $formfield instead). In case of a multiple="on" search, the pattern is applied to the line found in each search hit.• Specify a RegularExpression that covers the whole text (topic or line), which typically starts with .* , and must end in .* • Put text you want to keep in parenthesis, like $pattern(.*?(from here.*?to here).*) • Example: $pattern(.*?\*.*?Email\:\s*([^\n\r]+).*) extracts the e-mail address from a bullet of format * Email: ... • This example has non-greedy .*? patterns to scan for the first occurance of the Email bullet; use greedy .* patterns to scan for the last occurance • Limitation: Do not use .*) inside the pattern, e.g. $pattern(.*foo(.*)bar.*) does not work, but $pattern(.*foo(.*?)bar.*) does • Note: Make sure that the integrity of a web page is not compromised; for example, if you include an HTML table make sure to include everything including the table end tag |
$pattern(reg-exp, encode:type) |
A text extracted by reg-exp is encoded in the specified type. This is in parallel to $formfield(name, encode:type) mentioned above |
$count(reg-exp) |
Count of number of times a regular expression pattern appears in the text of a topic (does not search meta data). Follows guidelines for use and limitations outlined above under $pattern(reg-exp) . Example: $count(.*?(---[+][+][+][+]) .*) counts the number of <H4> headers in a page. |
$ntopics |
Number of topics found in current web. This is the current topic count, not the total number of topics |
$tntopics |
The total number of topics matched |
$nwebs |
The number of webs searched |
$nhits |
Number of hits if multiple="on" . Cumulative across all topics in current web. Identical to $ntopics unless multiple="on" |
$n or $n() |
New line. Use $n() if followed by alphanumeric character, e.g. write Foo$n()Bar instead of Foo$nBar |
$nop or $nop() |
Is a "no operation". This variable gets removed; useful for nested search |
$quot or \" |
Double quote (" ) |
$aquot |
Apostrophe quote (' ) |
$percnt |
Percent sign (% ) |
$dollar |
Dollar sign ($ ) |
$lt |
Less than sign (< ) |
$gt |
Greater than sign (> ) |
footer="..."
parameter footer="| *Topic* | *Summary* |"
Variables that can be used in the footer string:
Name: | Expands To: |
---|---|
$web |
Name of the web |
$ntopics |
Number of topics found in current web |
$tntopics |
The total number of topics matched |
$nwebs |
The number of webs searched |
$nhits |
Number of hits if multiple="on" . Cumulative across all topics in current web. Identical to $ntopics unless multiple="on" |
$n or $n() |
New line. Use $n() if followed by alphanumeric character, e.g. write Foo$n()Bar instead of Foo$nBar |
$nop or $nop() |
Is a "no operation". This variable gets removed; useful for nested search |
$quot or \" |
Double quote (" ) |
$aquot |
Apostrophe quote (' ) |
$percnt |
Percent sign (% ) |
$dollar |
Dollar sign ($ ) |
$lt |
Less than sign (< ) |
$gt |
Greater than sign (> ) |
default="..."
parameter default="| *Note* | Nothing found in the [[$web.WebHome][$web]] web |"
Variables that can be used in the default string:
Name: | Expands To: |
---|---|
$web |
Name of the web |
$n or $n() |
New line. Use $n() if followed by alphanumeric character, e.g. write Foo$n()Bar instead of Foo$nBar |
$nop or $nop() |
Is a "no operation". This variable gets removed; useful for nested search |
$quot or \" |
Double quote (" ) |
$aquot |
Apostrophe quote (' ) |
$percnt |
Percent sign (% ) |
$dollar |
Dollar sign ($ ) |
$lt |
Less than sign (< ) |
$gt |
Greater than sign (> ) |
%SEARCH{}%
are evaluated once before the search. This is OK for variables that do not change, such as %SCRIPTURLPATH%
. Variables that should be evaluated once per search hit must be escaped. For example, to escape a conditional:
%IF{ "..." then="..." else="..." }%
format="$percntIF{ \"...\" then=\"...\" else=\"...\" }$percnt"
%SEARCH{ "FAQ" scope="topic" nosearch="on" nototal="on" header=" * *Topic: Summary:*" format=" * [[$topic]]: $summary" footer=" * *Topic: Summary*" }%To get this:
TopicClassification
field, an OperatingSystem
field and an OsVersion
field we could write:
| *Topic:* | *OperatingSystem:* | *OsVersion:* |
%SEARCH{ "[T]opicClassification.*?value=\"[P]ublicFAQ\"" scope="text" type="regex" nosearch="on" nototal="on" format="| [[$topic]] | $formfield(OperatingSystem) | $formfield(OsVersion) |" }%
To get this:
Topic: | OperatingSystem | OsVersion |
---|---|---|
IncorrectDllVersionW32PTH10DLL | OsWin | 95/98 |
WinDoze95Crash | OsWin | 95 |
%SEARCH{ "__Back to\:__ TWikiFAQ" scope="text" type="regex" nosearch="on" nototal="on" header="TWiki FAQs:" format=" * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [[$topic][Answer...]]" }%To get this: TWiki FAQs:
%SEARCH{ "culture" format=" * $topic is referenced by: (list all references)" nosearch="on" nototal="on" }%
%SEARCH{ "(topic found in first search)" format="$topic" nosearch="on" nototal="on" separator=", " }%
$percnt
to escape the leading percent of the second search
\"
to escape the double quotes
$dollar
to escape the $
of $topic
$nop
to escape the }%
sequence
%SEARCH{ "culture" format=" * $topic is referenced by:$n * $percntSEARCH{ \"$topic\" format=\"$dollartopic\" nosearch=\"on\" nototal=\"on\" separator=\", \" }$nop%" nosearch="on" nototal="on" }%To get this:
$dollarpercntSEARCH{
for level three, $dollardollarpercntSEARCH{
for level four, etc.
Note: Another option, instead of a nested search, is to create a hash. Refer to the blog TWiki:Blog.BlogEntry201603x1. A search using hashes, if possible, may be significantly faster than a nested search.
%SEARCH{ "\.*" scope="topic" type="regex" nosearch="on" nototal="on" sort="modified" reverse="on" format="| [[$topic]] | $wikiusername | $date |" limit="7" }%=To get this:
WebPreferences | TWikiAdminUser | 2020-09-25 - 10:26 |
UserReports | TWikiContributor | 2015-05-29 - 23:43 |
WebTopBar | TWikiContributor | 2014-06-19 - 03:03 |
TWikiAccessDotPm | TWikiContributor | 2013-10-14 - 08:02 |
WebPreferencesHelp | TWikiContributor | 2013-09-25 - 19:36 |
VarADDTOHEAD | TWikiContributor | 2013-09-13 - 00:05 |
WysiwygPluginSettings | TWikiContributor | 2013-09-12 - 05:06 |
%CALCULATE{$SET(weekold, $TIMEADD($TIME(), -7, day))}%
%SEARCH{ "." scope="topic" type="regex" web="Main" nonoise="on" sort="modified" reverse="on" format="$percntCALCULATE{$IF($TIME($date) < $GET(weekold), <nop>, | [[$web.$topic][$topic]] | $wikiusername | $date | $rev |)}$percnt" limit="100" }%
weekold
variable to the serialized date of exactly one week ago
$percnt
makes sure that the CALCULATE gets executed once for each search hit
weekold
date
<nop>
is returned, which gets removed at the end of the TWiki rendering process
date="..."
paramter in SEARCH to restrict the date.
date=""
parameter as shown in the next example.
%SEARCH{ "." scope="topic" type="regex" web="%USERSWEB%" nonoise="on" sort="modified" reverse="on" format="| [[$web.$topic][$topic]] | $wikiusername | $date | $rev |" limit="100" date="P1w/$today" }%=To get this:
%URLPARAM{"..."}%
variable. Example:
Write this:
<form action="%SCRIPTURLPATH{"view"}%/TWiki/FormattedSearch"> Find Topics: <input type="text" name="q" size="32" value="%URLPARAM{"q" encode="entity"}%" /> <input type="submit" class="twikiSubmit" value="Search" /> </form> Result: %SEARCH{ search="%URLPARAM{"q" encode="search"}%" type="keyword" format=" * $web.$topic: %BR% $summary" nosearch="on" }%To get this: Result: Related Topics: UserDocumentationCategory, SearchHelp, VarSEARCH, VarENCODE, SearchResultsPagination, SearchPatternCookbook, RegularExpression, QuerySearch -- Contributors: TWiki:Main.PeterThoeny, TWiki:Main.CrawfordCurrie, TWiki:Main.SopanShewale
-- Main.TWikiGuest - 21 Sep 2024
-- [[Main.TWikiGuest][ZXQ]] - 21 Sep 2024
Contributors:
at the end of the page
http://etcete.ra/...
- it'll be clear to anyone where they're headed on click.
2024-09-01
(ISO 8601 date format) or 01 Sep 2024
(RFC 5322 date format) is preferred. It's clearer than the xx/xx/xx
format, where a date like 9/1/01 can mean either January or September, depending on the local conventions of the readers. For months, use the first three letters: Jan, Feb, Mar, Apr,...
[Edit]
on the lower toolbar. To see earlier versions, click [More topic actions]
, then check "Raw text format"
and click [View revision]
. A bit of HTML experience can't hurt, but you'll soon see with TWikiShorthand how far that is from necessary.
%HEADLINES{"..."}%
Parameter | Explanation | Default |
---|---|---|
"..." |
Source of RSS or ATOM feed; this can be an url (starting with http) or a web.topic location for internal feeds | None; is required |
href="..." |
(Alternative to above) | N/A |
refresh="60" |
Refresh rate in minutes for caching feed; "0" for no caching |
Global REFRESH setting |
limit="12" |
Maximum number of items shown | Global LIMIT setting |
header="..." |
Header. May include these variables: - $channeltitle , $title : title of channel (channel.title) - $channellink , $link : link of channel (channel.link) - $channeldescription , $description : description (channel.description) - $channeldate , $date : publication date of the channel (channel.pubDate) - $rights : copyrights of the channel (channel.copyright) - $imagetitle : title text for site (image.title) - $imagelink : link for site (image.link) - $imageurl : URL of image (image.url) - $imagedescription : description of image (image.description) |
Global HEADER setting |
format="..." |
Format of one item. May include these variables: - $title : news item title (item.title) - $link : news item link (item.link) - $description : news item description (item.description) - $date : the publication date (item.pubDate, item.date) - $category : the article category (item.category) |
Global FORMAT setting |
newline="$br" |
Convert newlines in feed; "$br" becomes <br /> tag |
"$n" (newline) |
filter="..." |
Filter out content from feed; for example to delete an encoded break tag specify "<br>" |
"" |
touch="..." |
Touch (edit/save) topics if the feed has updates. Specify a comma-space delimited list of TopicNames or Web.TopicNames, such as "%TOPIC%, NewsLetter" . Useful to send out newsletter using MailerContrib, showing new feeds since last newsletter. To update feeds, visit topics with feeds in regular intervals (using cron with wget or the like). |
N/A |
header
and format
parameters might also use variables rendering the dc
, image
and content
namespace information. Note, that only bits of interest have been implemented so far and those namespaces might not be implemented fully yet.
dc
namespace dc
namespace info, that could be used in header
and format
. Note that some of the variables are already used above. This is done by purpose to use different feeds with the same formatting parameters. If there's a conflict the non-dc tags have higher precedence, i.e. a <title> content </title>
is preferred over <dc:title> content </dc:title>
. $title
: channel/article title (dc:title)
$creator
: channel creator (dc:creator)
$subject
: subject text; this will also add an image according to the subject hash list, see above (dc:subject)
$description
: ... (dc:description)
$publisher
: the channel/article publisher (dc:publisher)
$contributor
: ... (dc:contributor)
$date
: ... (dc:date)
$type
: ... (dc:type)
$format
: ... (dc:format)
$identifier
: ... (dc:identifier)
$source
: ... (dc:source)
$language
: ... (dc:language)
$relation
: ... (dc:relation)
$coverage
: ... (dc: coverage)
$rights
: ... (dc: rights)
image
namespace image:item
is converted into an <img> tag using the following mappings: src
: image url (rdf:about attribute of the image.item tag)
alt
: image title (title)
width
: image width (image:width)
height
: image height image:height)
content
namespace $content
is referring to the <content:encoding> content </content:encoding>
.
%HEADLINES{ "http://slashdot.org/slashdot.rdf" header="*[[$link][$title]]:* $description" format="$t* [[$link][$title]]" limit="4" }%to get the latest Slashdot news as a bullet list format:
HEADLINESPLUGIN_USERAGENTNAME
setting, add a * Set HEADLINESPLUGIN_USERAGENTNAME = ...
bullet in Main.TWikiPreferences.
0
to disable caching: 1
, or fallback to TWiki's internal getUrl()
method if set to 0
: * Set HEADLINESPLUGIN_HEADER = <div class="headlinesChannel"><div class="headlinesLogo"><img src="$imageurl" alt="$imagetitle" border="0" />%BR%</div><div class="headlinesTitle">$n---+!! <a href="$link">$title</a></div><div class="headlinesDate">$date</div><div class="headlinesDescription">$description</div><div class="headlinesRight">$rights</div></div>
* Set HEADLINESPLUGIN_FORMAT = <div class="headlinesArticle"><div class="headlinesTitle"><a href="$link">$title</a></div>$n<span class="headlinesDate">$date</span> <span class="headlinesCreator"> $creator</span> <span class="headlinesSubject"> $subject </span>$n<div class="headlinesText"> $description</div></div>
0
, HTML is not allowed those in parameters. This is to guard against Cross-Site Scripting (XSS) attacks. The HEADLINESPLUGIN_HEADER and HEADLINESPLUGIN_FORMAT plugin settings allow HTML regardless of this setting. $TWiki::cfg{PROXY}{HOST}
- proxy host, such as "proxy.example.com";
$TWiki::cfg{PROXY}{PORT}
- proxy port, such as "8080";
$TWiki::cfg{PROXY}{SkipProxyForDomains}
- domains excluded from proxy, such as "intra.example.com, bugs.example.com";
headlinesRss
: output of the HeadlinesPlugin (div) headlinesChannel
: channel header (div) headlinesLogo
: channel logo (div)
headlinesTitle
: channel title (div)
headlinesDate
: channel date (div)
headlinesDescription
: channel description (div)
headlinesRight
: channel copyright (div)
headlinesArticle
: one news item (div) headlinesTitle
: article title (div)
headlinesDate
: article date (span)
headlinesCreator
: author of article (span)
headlinesSubject
: subect category of the article (span)
headlinesText
: article text (div)
HeadlinesPlugin.zip
in your twiki installation directory. Content: File: | Description: |
---|---|
data/TWiki/HeadlinesPlugin.txt | Plugin topic |
pub/TWiki/HeadlinesPlugin/style.css | Default CSS |
lib/TWiki/Plugins/HeadlinesPlugin.pm | Plugin Perl module |
lib/TWiki/HeadlinesPlugin/Core.pm | Plugin core |
Name | Version | Description |
---|---|---|
Digest::MD5 | >=2.33 | Required. Download from CPAN:Digest::MD5 |
LWP::UserAgent | >=5.803 | Optional. Download from CPAN:LWP::UserAgent |
Plugin Author: | TWiki:Main.PeterThoeny, TWiki:Main.MichaelDaum |
Copyright: | © 2002-2018 Peter Thoeny, TWiki.org; © 2002-2018 TWiki:TWiki.TWikiContributor; © 2005-2007 Michael Daum wikiring.de |
License: | GPL (GNU General Public License) |
Plugin Version: | 2018-07-13 |
2018-07-13: | TWikibug:Item7846: Sanitize parameters; add HEADLINESPLUGIN_ALLOWHTML setting; sanitize malicious scripts in feed; remove non-functional Wired feed example |
2018-07-05: | TWikibug:Item7841: Copyright update to 2018 |
2016-01-08: | TWikibug:Item7708: Copyright update to 2016 |
2015-11-06: | TWikibug:Item7697: New filter and newline parameters; fix Atom feed parser to support Google Alerts |
2015-07-28: | TWikibug:Item7678: HeadlinesPlugin not working well on Fast CGI and mod_perl |
2015-01-10: | TWikibug:Item7604: Switch from GPL v2 to v3 |
2013-11-18: | TWikibug:Item7385: Encode "[" and "]" to avoid problems with TWiki [[...][...]] links; code-refactor to use registerTagHandler and OO style. |
2013-02-16: | TWikibug:Item7091: Use TWISTY in installation instructions section and change history |
2013-01-29: | TWikibug:Item7131: HeadlinesPlugin doesn't match pattern in multiple lines. |
2012-12-10: | TWikibug:Item7070: HeadlinesPlugin doesn't support multiple disks. |
2012-11-13: | TWikibug:Item7016: Restore changes for earlier versions with LWP |
2012-11-13: | TWikibug:Item7020: Categorize TWiki Variable |
2012-10-31: | TWikibug:Item7016: Utilize <guid> value when it is available |
2012-09-05: | TWikibug:Item6837: Doc fixes |
2011-07-17: | TWikibug:Item6764: Add VarHEADLINES variable documentation; doc improvements; setting NO_PREFS_IN_TOPIC |
2011-07-08: | TWikibug:Item6725: Change global package variables from "use vars" to "our" |
2010-05-16: | TWikibug:Item6433: More doc improvements |
2010-04-25: | TWikibug:Item6433: Doc fix: Changing TWIKIWEB to SYSTEMWEB |
2010-02-27: | TWikibug:Item6313: Fixed bug in ATOM feed with <link ...></link> instead of <link ... /> -- Peter Thoeny |
2009-09-30: | fixed bug in lastBuildDate of feeds affecting touch parameter functionality -- Peter Thoeny |
2009-08-29: | added touch parameter -- Peter Thoeny |
12 Feb 2009: | {PROXY}{HOST} supports domain with and without protocol -- Peter Thoeny |
06 Feb 2009: | added {PROXY}{SkipProxyForDomains} configure setting, added USERAGENTNAME plugin setting -- Peter Thoeny |
11 Dec 2008: | added {PROXY}{HOST} and {PROXY}{PORT} configure settings -- Peter Thoeny |
13 Sep 2007: | fixed parsing of content:encoded |
23 Jul 2006: | improved atom parser; if a posting has no title default to 'Untitled' |
26 Apr 2006: | added lazy compilation |
10 Feb 2006: | packaged using the TWiki:Plugins/BuildContrib; minor fixes |
03 Feb 2006: | off-by-one: limit="n" returned n+1 articles; make FORMAT and HEADER format strings more robust |
23 Jan 2006: | released v2.00 |
05 Dec 2005: | internal feed urls must be absolute |
02 Dec 2005: | added web.topic shorthand for internal feeds |
29 Nov 2005: | fixed CDATA handling |
21 Nov 2005: | added ATOM support; extended RSS support; added dublin core support; added content support; optionally using LWP to fetch feeds to follow redirections; corrected CPAN dependencies ; recoding special chars from html integer to entity encoding to increase browser compatibility; added css support; use getWorkArea() if available |
11 May 2005: | TWiki:Main.WillNorris: added DevelopBranch compatability |
31 Oct 2004: | Fixed taint issue by TWiki:Main.AdrianWeiler; small performance improvement |
29 Oct 2004: | Fixed issue of external caching if mod_perl or SpeedyCGI is used |
02 Aug 2002: | Implemented caching of feeds, thanks to TWiki:Main/RobDuarte |
11 Jun 2002: | Initial version (V1.000) |
Perl Version: | 5.8 |
Plugin Benchmark: | GoodStyle 100%, FormattedSearch 99.5%, HeadlinesPlugin 94% |
Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/HeadlinesPlugin |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/HeadlinesPluginDev |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/HeadlinesPluginAppraisal |
[action]
link,
"Hide file"
checkbox,
[Change properties]
all
children
generates: When included in WebLeftBar (using default Pattern skin) this is styled to:%INCLUDE{"%SYSTEMWEB%.HierarchicalNavigation" section="all"}%
generates: Child topics: When included in WebLeftBar (using default Pattern skin) this is styled to:*Child topics:* %INCLUDE{"%SYSTEMWEB%.HierarchicalNavigation" section="children"}%
%IF%
construct gives TWiki the power to include content in topics based on the value of simple expressions.
%IF{"CONDITION" then="THEN" else="ELSE"}%
In the example above, if CONDITION evaluates to TRUE, then THEN will be shown in the topic; otherwise ELSE will be shown.
Note that because of the way TWiki evaluates, then whatever is in the THEN and ELSE parameters will already have been expanded by the time the condition is actually evaluated. The standard FormatTokens such as $percnt
for %
can be used in the THEN and ELSE parameters when you need to delay evaluation of (for example) a TWiki variable.
The basic syntax of a condition is the same as the syntax used for queries, with operators =
, !=
, ~
, <
, >
, <=
, >=
, NOT
, AND
, OR
, ()
, and functions lc()
, uc()
, d2n()
.
In addition, the following special operators are supported:
context |
True if the current context is set (see below) |
allows |
'X' allows 'Y' is true if web/topic 'X' exists and allows access mode 'Y' for the current user. Web access rights are only checked if there is no topic called 'X'. |
istopic |
istopic 'X' is true if topic 'X' exists |
isweb |
isweb 'X' is true if web 'X' exists |
ingroup |
'X' ingroup 'Y' is true if user 'X' is in group 'Y'. 'X' can be a login name or a wikiname. |
defined |
True if a preference variable or url parameter of this name is defined. |
isempty |
True if a preference variable, url parameter or session variable of this name has an empty value. It is equivalent to the expression (defined(x) || $x='') |
$ |
expands a URL parameter or TWikiVariable name. Plugin handlers are not called. Built-in variables and user-defined preferences are supported. You can pass a limited subset of parameters to TWiki variables by enclosing the variable name in single quotes; for example, $ 'VARIABLE{value}' . The 'VARIABLE{value}' string may not contain quotes (' or "). |
{X} |
expands to the value of the configuration variable {X} - for example, {ScriptUrlPath} |
"{AntiSpam}{HideUserDetails}"
. It is not possible see the value of a configuration. Configuration items are defined in configure.
You can test if a context identifier is set or not, using conditions such as "context authenticated"
. Context identifier are used in TWiki to label various stages of the rendering process. They are especially useful for skin authors to find out where they are in the rendering process. The following context identifiers are available:
id | context |
---|---|
absolute_urls |
Set if absolute URLs are required |
attach |
in attach script (see TWikiScripts) |
authenticated |
a user is authenticated |
body_text |
when the body text is being processed in a view (useful in plugin handlers) |
can_login |
current environment supports login |
changes |
in changes script (see TWikiScripts) |
command_line |
the running script was run from the command line, and not from CGI |
content_master |
with the current web, this site is the master of the federated sites (see ReadOnlyAndMirrorWebs) |
content_slave |
with the current web, this site is a slave and another site in the federation is the master (see ReadOnlyAndMirrorWebs) |
diff |
in rdiff script (see TWikiScripts) |
edit |
in edit script (see TWikiScripts) |
footer_text |
when the footer text is being processed in a view (useful in plugin handlers) |
header_text |
when the header text is being processed in a view (useful in plugin handlers) |
i18n_enabled |
when user interface I18N support is enabled (i.e., user can choose the language for UI) |
inactive |
if active links such as 'edit' and 'attach' should be disabled; a read-only web puts all topics in this context (see ReadOnlyAndMirrorWebs) |
login & logon |
in login / logon script (see TWikiScripts) |
manage |
in manage script (see TWikiScripts) |
new_topic |
if the topic doesn't already exist |
oops |
in oops script (see TWikiScripts) |
preview |
in preview script (see TWikiScripts) |
register |
in register script (see TWikiScripts) |
rename |
in rename script (see TWikiScripts) |
resetpasswd |
in resetpasswd script (see TWikiScripts) |
rss |
if this is an RSS skin rendering |
save |
in save script (see TWikiScripts) |
search |
in search script (see TWikiScripts) |
statistics |
in statistics script (see TWikiScripts) |
textareas_hijacked |
provided for use by editors that highjack textareas, and want to signal this fact. This is used by skins, for example, so they can suppress extra controls when textareas have been hijacked. |
upload |
in upload script (see TWikiScripts) |
view |
in view script (see TWikiScripts) |
viewfile |
in viewfile script (see TWikiScripts) |
rest |
in rest script (see TWikiScripts) |
registration_supported |
registration is supported by the current UserMapper |
registration_enabled |
set if {Register}{EnableNewUserRegistration} is on, and registrationis supported |
passwords_modifyable |
set if the password manager support changing the password / email |
GallousTwistyPlugin
is installed and enabled, then the context ID GallousTwistyPluginEnabled
will be set. Other extensions may set additional context identifiers.
The %IF{}%
statement is deliberately kept simple. In particular, note that there is no way to conditionally execute a Set statement. If you need more sophisticated control over formatting, then consider using the SpreadSheetPlugin.
Note also that while the query syntax can be used to access form fields, there are some contexts in which an IF statement may be used where there is no topic context, or the topic context is not what you expected.
%IF{"defined 'WIKINAME'" then="WIKINAME is defined" else="WIKINAME is not defined"}%2. Compare TWiki variable
You are %IF{ "$ WIKINAME='TWikiGuest' and not defined 'OPEN_DAY'" then="not" }% allowed to %IF{ "context view" then="view" else="edit"}% this TWiki today.3. URL parameter
%IF{ "defined 'search'" then="Search: $percntURLPARAM{search}$percnt" else="No search passed in"}%4. Range test on URL parameter
url param t is %IF{ "0 < $ t and $ t < 1000" then="in" else="out of"}% range.5. Text comparison of URL parameter
%IF{ "$'URLPARAM{scope}'='text'" then="Plain text search" }%6. Configuration item set or not
%IF{ "{AntiSpam}{HideUserDetails}" then="User details are hidden" }%7. Plugin enabled test
TablePlugin is %IF{ "context TablePluginEnabled" then="enabled" else="disabled" }%.expands to:
You %IF{"'IfStatements' allows 'change'" then="can" else="cannot"}% change this topic. You %IF{"'Sandbox.TestTopic' allows 'change'" then="can" else="cannot"}% change Sandbox.TestTopic. You %IF{"'Sandbox' allows 'change'" then="can" else="cannot"}% change Sandbox webexpands to:
Topic Sandbox.TestTopic %IF{"istopic 'Sandbox.TestTopic'" then="exists" else="does not exist"}% Web Sandbox.WebHome %IF{"isweb 'Sandbox'" then="exists" else="does not exist"}%expands to:
You %IF{"'%USERNAME%' ingroup 'TWikiAdminGroup'" then="are an admin" else="are a normal user"}%expands to:
%IF{"'%USERNAME%' ingroup 'ExecutiveGroup'" then="$percntINCLUDE{ExecutiveReport}$percnt"}%The ExecutiveReport topic is only included if the user is in the ExecutiveGroup. 12. Hide section of text conditionally using CSS display
<div style="display: %IF{"'%USERNAME%' ingroup 'TWikiAdminGroup'" then="block" else="none"}%"> * Conditional text enclosed in div tags here... * ...can be as long as needed </div>Above text is only shown to users who are in the TWikiAdminGroup. Related Topics: QuerySearch, VarIF, VarGET, VarSET, VarSEARCH, FormattedSearch, FormatTokens, SpreadSheetPlugin, TWikiScripts -- Contributors: TWiki:Main.ArthurClemens, TWiki:Main.CrawfordCurrie, TWiki:Main.PeterThoeny, TWiki:Main.SopanShewale, TWiki:Main.SvenDowideit, TWiki:Main.WillNorris - 2012-08-07
raw="on"
is specified, that variable expansion does not happen.
This topic explains what it is for and what it really means.
EOTC__
to a variable name.
Leveraging INCLUDE
with raw="on"
, a template topic can be composed of multiple topics.
Let's say there is a topic named ThreePartTemplate as follows.
%EOTC__INCLUDE{"TmplPartA" raw="on"}% %EOTC__INCLUDE{"TmplPartB" raw="on"}%Thanks to
raw="on"
, TWiki variables in TmplPartA and TmplPartB are not expanded when those topics are included.
Since most variables are not expanded in topic creation, most variables in TmplPartA and TmplPartB are put as they are in the new topic.
Let's assume TmplPartA contains %CALENDAR%
. It will show up as is in a topic created based on ThreePartTemplate. %CALENDAR%
is not subject to expansion in topic creation, so it's left as is in the created topic.
raw="on'
wasn't present, %CALENDAR%
would be expanded in the context of TmplPartA.
%CALENDAR%
on it.
%TOPIC%
.
IncludedTopic: %TOPIC%
If that's included by another topic IncludingTopic with raw="on"
parameter and this enhancement is in effect, IncludingTopic shows IncludedTopic.
IncludingTopic: %INCLUDE{"IncludedTopic" raw="on"}%
-> IncludingTopic
This is because when IncludedTopic is included by IncludingTopic, the variable %TOPIC%
is not expanded and
the processing of %INCLUDE{"IncludedTopic" raw="on"}%
ends there.
Then, %TOPIC%
is expanded in the IncludingTopic's context.
On the other hand, if you don't have raw="on"
, %TOPIC%
is expanded in IncludedTopic's context.
IncludingTopic: %INCLUDE{"IncludedTopic"}%
-> IncludedTopic
Related Topics: VarINCLUDE, TWikiTemplates#Variable_Expansion%INCLUDE{...}%
Variable %INCLUDE{...}%
variable to embed the content of another topic or web page inside a TWiki topic. The whole content or only parts of a page can be included. If needed, set a proxy server in TWikiPreferences.
%INCLUDE{ "page" pattern="reg-exp" rev="2" warn="off" section="clients" PARAMETER1="value" PARAMETER2="Some value"}%
The pattern
parameter is optional and allows you to extract some parts of a web page. Specify a RegularExpression that scans from start ('^'
) to end and contains the text you want to keep in parenthesis, e.g., pattern="^.*?(from here.*?to here).*"
. You need to make sure that the integrity of a web page is not compromised; for example, if you include an HTML table, make sure to include everything including the table end tag.
The example parameters PARAMETER1 and PARAMETER2 will be defined as a variable within the scope of the included topic. The example parameters shown will result in %PARAMETER1% and %PARAMETER2% being defined within the included topic. A default value can be specified such as %PARAMETER1{ default="..." }% in case the INCLUDE does not specify the parameter. Parametrized includes can be used to define and use macros, which is an alternative to parameterized variables.
VarINCLUDE explains the other parameters.
Note: All text of a topic is included unless it contains a %STARTINCLUDE%
and %STOPINCLUDE%
, or you specify a section
parameter and/or a pattern
parameter. A pattern will only search between %STARTINCLUDE%
and %STOPINCLUDE%
.
<pre> %INCLUDE{"http://domain/~qa/v1.1/REDTest.log.txt"}% </pre>
%INCLUDE{"http://www.google.com/robots.txt"}%
Tokyo: %INCLUDE{"http://TWiki.org/cgi-bin/xtra/tzdate?tz=Asia/Tokyo" pattern="^.*<\!--tzdate:date-->(.*?)<\!--/tzdate:date-->.*"}%
---+!! Breadslicer Users Guide %TOC{ depth="3" }% %INCLUDE{ "UsersGuidePreface" headingoffset="1" }% %INCLUDE{ "UsersGuideChapter1" headingoffset="1" }% %INCLUDE{ "UsersGuideChapter2" headingoffset="1" }% %INCLUDE{ "UsersGuideChapter3" headingoffset="1" }% %INCLUDE{ "UsersGuideChapter4" headingoffset="1" }% %INCLUDE{ "UsersGuideAppendix" headingoffset="1" }% %INCLUDE{ "UsersGuideIndex" headingoffset="1" }%
%INCLUDE{ "MyTopic" BETTER="apples" WORSE="Oranges"}%An example of a very simple MyTopic could contain
* I like %BETTER% better than %WORSE%.The result would be
----- %STARTINCLUDE% <div style="border-color:#FF9933; border-style:solid; border-width:thin; width:85%; margin: 0 auto"> <table cellpadding="5" width="100%" cellspacing="0" cellpadding="12" border="0"> <tr bgcolor="#FFBB55"> <td valign="top" width="16"><img src="%ICONURL{warning}%" width="16" height="16" align="absmiddle" alt="" border="0"></td> <td><b> %TITLE{ default="Alert!" }% </b></td> </tr> <tr bgcolor="#FFCC66"> <td> </td> <td> %MESSAGE{ default="Please specify a MESSAGE parameter." }% </td> </tr> </table> </div> %STOPINCLUDE% -----Now you can write
%INCLUDE{ "AlertBox" TITLE="Alert" MESSAGE="This a test message" }%
to get this:
Alert | |
This a test message |
TITLE=""
and MESSAGE=""
parameters are passed into the include. Using this approach, you can create a library of boxes in the Main web, such as Main.NoteBox, Main.InfoBox.
%STARTSECTION{AlertBox}%
... %ENDSECTION{AlertBox}%
(instead of the %STOPINCLUDE%
... %STOPINCLUDE%
)
%INCLUDE{ "Main.WidgetLibrary" section="AlertBox" TITLE="Alert" MESSAGE="The sky is the limit!" }%
"$SUM( $ABOVE() )"
to TWiki tables or anywhere in topic text ExternalSite:Page
to link to a page on an external site based on aliases defined in a rules topic :-)
as or :eek:
as Plugin | Errors |
---|---|
SpreadSheetPlugin | none |
BackupRestorePlugin | none |
ColorPickerPlugin | none |
CommentPlugin | none |
DatePickerPlugin | none |
EditTablePlugin | none |
HeadlinesPlugin | none |
InterwikiPlugin | none |
JQueryPlugin | none |
PreferencesPlugin | none |
SetGetPlugin | none |
SlideShowPlugin | none |
SmiliesPlugin | none |
TWikiSheetPlugin | none |
TablePlugin | none |
TagMePlugin | none |
TinyMCEPlugin | none |
TwistyPlugin | none |
WatchlistPlugin | none |
WysiwygPlugin | none |
Handler | Plugins |
---|---|
afterEditHandler | WysiwygPlugin |
afterRenameHandler | TagMePlugin WatchlistPlugin |
afterSaveHandler | TagMePlugin WatchlistPlugin |
beforeCommonTagsHandler | EditTablePlugin PreferencesPlugin TWikiSheetPlugin TwistyPlugin WysiwygPlugin |
beforeEditHandler | TinyMCEPlugin WysiwygPlugin |
beforeMergeHandler | WysiwygPlugin |
beforeSaveHandler | CommentPlugin WatchlistPlugin WysiwygPlugin |
commonTagsHandler | SpreadSheetPlugin BackupRestorePlugin CommentPlugin EditTablePlugin JQueryPlugin SlideShowPlugin SmiliesPlugin TWikiSheetPlugin |
initPlugin | SpreadSheetPlugin BackupRestorePlugin ColorPickerPlugin CommentPlugin DatePickerPlugin EditTablePlugin HeadlinesPlugin InterwikiPlugin JQueryPlugin PreferencesPlugin SetGetPlugin SlideShowPlugin SmiliesPlugin TWikiSheetPlugin TablePlugin TagMePlugin TinyMCEPlugin TwistyPlugin WatchlistPlugin WysiwygPlugin |
modifyHeaderHandler | WysiwygPlugin |
postRenderingHandler | PreferencesPlugin WysiwygPlugin |
preRenderingHandler | InterwikiPlugin SmiliesPlugin TablePlugin |
%FAILEDPLUGINS%
variable
Related Topics: TWikiPlugins, TWikiPreferences, AdminDocumentationCategory, AdminToolsCategory, TWikiSkinBrowserview.tmpl
(in the templates
directory). In the HTML at the top, the body tag has the page background hardcoded to white bgcolor="#ffffff"
. You can change that color value to new variable. First, define a new preferences variable in the site-level Main.TWikiPreferences, e.g. * Set =PAGEBGCOLOR = #d0d0d0
, then edit the view.tmpl
template file and change bgcolor="#ffffff"
to bgcolor="%PAGEBGCOLOR%"
. If you want, you can set the page background color individually per web, simple add a * Set =PAGEBGCOLOR = #d0d0d0
bullet to the WebPreferences to overload the site-level preferences. (Without font color control, you'll have to stick to light colors.)
WebIndex
with WebTopicList
, and save.
Edit
is disabled. Instead, go to More
and view the topic in raw
format.
days.gif
. To show this image in a topic, write %ICON{"days"}%
to get .
Creating image variables
You may find it easier to write shorthand graphic notation. You can create your own image variables by defining them in a preference topic (most likely Main.TWikiPreferences.)
A variable name may be one letter, like Y
, or may be longer like HELP
, WARN
etc. You can also add your own images, e.g. a NEW
, or a ASK
to ask question.
For instance, if we want to write %DOWN%
instead of %ICON{"arrowbdown"}%
, define the new variable like this:
* Set DOWN = %ICON{"arrowbdown"}%Or if you have a custom image to use, attach this to Main.TWikiPreferences and write:
* Set DOWN = <img src="https://lcc.inversion-lab.com/pub/TWiki/InstantEnhancements/my_image.gif" border="0" alt="DOWN" width="16" height="16" />Most images in TWikiDocGraphics are 16 x 16 pixels.
---++
, see TWikiShorthand).
For example, you may want to put all your custom variables in Main.TWikiPreferences right on top of the page, and generate table of contents, like:
w3m
pager/browser for Linux. This is a text based version similar to lynx
but it includes text editor features and a configurable command set to act like lynx
if you are more accustomed to it.
__Here's a list of topics I've been involved in recently:__ ---++++ Codev %SEARCH{ "InstantEnhancements" web="Codev" scope="text" nosearch="on" nosummary="on" noheader="on" nototal="on" sort="modified" reverse="on" limit="20"}% ---++++ Support %SEARCH{ "InstantEnhancements" web="Support" scope="text" nosearch="on" nosummary="on" noheader="on" nototal="on" sort="modified" reverse="on" limit="20"}% ---++++ TWiki %SEARCH{ "InstantEnhancements" web="TWiki" scope="text" nosearch="on" nosummary="on" noheader="on" nototal="on" sort="modified" reverse="on" limit="10"}%End Copy The SEARCH variable has many more formatting options, see TWikiVariables.
<table> %SEARCH{ "\.*" scope="topic" type="regex" nosearch="on" nototal="on" sort="modified" reverse="on" format="<tr><td> [[$topic][$topic]] </td><td> $wikiusername </td><td> $date </td></tr>" limit="15" }% </table>
Edit
. Set ALLOWTOPICCHANGE = Main.UserName, Main.GroupName
<!--
on the line _above the setting, and -->
on the line below.
Set WEBLOGONAME = filename.gif
WEBLOGOIMG
, WEBLOGOURL
, and WEBLOGOALT
(they mirror the WIKILOGO*
TWiki variables, but are applied to each web, rather than to the %WIKITOOLNAME%-based references)
If you'd like to have the same customized logo for all the webs, make these changes in TWikiPreferences instead of each web's WebPreferences, e.g., Set WEBLOGOIMG = %PUBURLPATH%/Main/WebPreferences/mylogo.gif
view.pattern.tmpl
(if you are using default pattern skin) (in the templates
directory) for some dramatic effects. The top of the template is mostly regular HTML with some variables. Open up some space in the <head>
area, and you can drop in reliable JavaScripts - a pop-up window script, for example - or tag it as an external script.
ExternalSite:Page
it will be linked automatically to the page on the external site. The link points to the URL corresponding to the ExternalSite
alias below, concatenated to the Page
you choose. Example: Type Wiki:RecentChanges
to get Wiki:RecentChanges, the RecentChanges page at the original Wiki site.
| External site alias | URL | Tooltip help text |
.
$page
variables; the variable gets expanded to the page name.
<nop>
escape code), no internal WikiWord links, and no external links. Hint: Escape 'WikiWords'
and '$page'
.
Alias: | URL: | Tooltip Text: |
---|---|---|
Acronym | http://www.acronymfinder.com/af-query.asp?Acronym=$page&String=exact | Look up '$page' on Acronym Finder site |
CPAN | http://search.cpan.org/perldoc? | CPAN perl repository |
Dictionary | http://www.dictionary.com/cgi-bin/dict.pl?term= | Look up '$page' at Dictionary.com |
http://google.com/search?q= | Search for '$page' on Google | |
Group | http://groups.google.com/groups?hl=en&safe=off&group= | News group '$page' at Google.com |
ISBN | http://www.bookfinder.com/search/?st=sr;ac=qr;isbn= | Book with ISBN $page |
Map | https://www.google.com/maps/place/ | Google map |
News | http://news.google.com/news?q= | Search for '$page' on Google news |
RFC | http://www.faqs.org/rfcs/rfc$page.html | IETF RFC #$page |
Alias: | URL: | Tooltip Text: |
---|---|---|
Advogato | http://www.advogato.org/ | '$page' on Advogato community site (with peer review) |
C2find | http://c2.com/cgi/wiki?FindPage&value= | Search '$page' on the original 'WikiWikiWeb' site |
DokuWiki | http://wiki.splitbrain.org/wiki: | '$page' on Doku Wiki site |
DolphinWiki | http://www.object-arts.co.uk/wiki/html/Dolphin/$page.htm | '$page' on Dolphin Wiki site |
FoxWiki | http://fox.wikis.com/wc.dll?Wiki~ | '$page' on Fox Wiki site |
HammondWiki | http://www.dairiki.org/HammondWiki/index.php3? | '$page' on 'HammondWiki' site |
LegoWiki | http://www.object-arts.com/wiki/html/Lego-Robotics/ | '$page' on 'LegoWiki' site |
MbTest | http://www.usemod.com/cgi-bin/mbtest.pl? | '$page' on 'UseMod' Wiki variant |
MeatBall | http://www.usemod.com/cgi-bin/mb.pl? | '$page' on 'MeatBall' site, a 'UseMod' Wiki variant |
MoinMoin | http://moinmoin.wikiwikiweb.de/ | '$page' on 'MoinMoin' Wiki site |
MuWeb | http://www.dunstable.com/scripts/MuWebWeb? | '$page' on 'MuWeb' site |
OrgPatterns | http://www.easycomp.org/cgi-bin/OrgPatterns? | '$page' on Organizational Patterns site |
PhpWiki | http://phpwiki.sourceforge.net/phpwiki/index.php3? | '$page' on Wiki site written in PHP |
PolitizenWiki | http://www.politizen.com/wiki.asp? | '$page' on 'PolitizenWiki' site |
PPR | http://c2.com/cgi/wiki? | '$page' on the original 'PortlandPatternRepository' site |
PyWiki | http://www.voght.com/cgi-bin/pywiki? | '$page' on Wiki site written in Python |
Squeak | http://minnow.cc.gatech.edu/squeak/ | '$page' on Squeak Smalltalk Wiki |
TWiki | http://twiki.org/cgi-bin/view/ | '$page' on TWiki.org |
TWikibug | http://develop.twiki.org/do/view/Bugs/ | '$page' on the TWiki issue tracking site |
TWikirev | http://develop.twiki.org/trac/changeset/ | revision $page of TWiki svn |
TWikisvn | http://svn.twiki.org/svn/twiki/trunk/ | Download '$page' file from TWiki SVN repository |
UseMod | http://www.usemod.com/cgi-bin/wiki.pl? | '$page' on 'UseMod' Wiki site |
VisualWorks | http://wiki.cs.uiuc.edu/VisualWorks/ | '$page' on 'VisualWorks' site |
Wiki | http://c2.com/cgi/wiki? | '$page' on the original 'WikiWikiWeb' site |
Wikipedia | http://en.wikipedia.org/wiki/ | '$page' on 'Wikipedia' |
ZWiki | http://joyful.com/zwiki/ | '$page' on Zope's Wiki |