|
From: <de...@de...> - 2016-08-09 10:12:29
|
Author: HideyoImazu Date: 2016-08-09 10:11:46 +0000 (Tue, 09 Aug 2016) New Revision: 30237 Trac url: http://develop.twiki.org/trac/changeset/30237 Modified: twiki/trunk/core/data/TWiki/TWikiScripts.txt Log: Item7749: Setting redirectto by preference variable Modified: twiki/trunk/core/data/TWiki/TWikiScripts.txt =================================================================== --- twiki/trunk/core/data/TWiki/TWikiScripts.txt 2016-08-03 05:44:06 UTC (rev 30236) +++ twiki/trunk/core/data/TWiki/TWikiScripts.txt 2016-08-09 10:11:46 UTC (rev 30237) @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="TWikiContributor" date="1458793927" format="1.1" version="$Rev$"}% +%META:TOPICINFO{author="TWikiContributor" date="1470737465" format="1.1" version="$Rev$"}% %STARTINCLUDE% ---+ TWiki CGI and Command Line Scripts @@ -45,6 +45,17 @@ | =skin= | Overrides the default skin path (see TWikiSkins) | | | =cover= | Specifies temporary skin path to prepend to the skin path for this script only (see TWikiSkins) | | +#RedirecttoParameter +---++++ redirectto parameter +Some scripts take the =redirectto= parameter. +Since the parameter's effect is not simple, it's described here. + +The parameter value can either be a =TopicName=, a =Web.TopicName= (optionally with parameters e.g. =FooBar?param1=value1=), or a URL. +Please note that redirect to a URL only works if it is enabled in =configure= (Security setup > Miscellaneous ={AllowRedirectUrl}=). + +If the parameter value contains a =${field}= or =$field=, it's replaced with the value of the specified field of the page. +To know what fields are there on the page, please look into the HTML of the page. + #AttachScript ---+++ =attach= @@ -89,7 +100,7 @@ | =contenttype= | Optional parameter that defines the application type to write into the CGI header. Defaults to =text/html=. May be used to invoke alternative client applications | | | =anyname= | Any parameter can passed to the new topic; if the template topic contains =%<nop>URLPARAM{"anyname"}%=, it will be replaced by its value | | | =breaklock= | If set, any lease conflicts will be ignored, and the edit will proceed even if someone is already editing the topic. | | -| =redirectto= | If the user continues from edit to save, and if the save (or cancels the edit) process is successful, save will redirect to this topic or URL. The parameter value can be a =TopicName= or a =Web.TopicName= (optionally with parameters e.g. =FooBar?param1=value1=), or a URL.%BR% __Note:__ Redirect to a URL only works if it is enabled in =configure= (Security setup > Miscellaneous ={AllowRedirectUrl}=). | | +| =redirectto= | The =edit= script itself does not do anything special with this parameter. But the edit template is written so that the parameter's value is propagated to =save=, which is called when a topic is saved. | | | =t= | Provide a unique URL each time a topic is edited, typically specifying parameter =t=%<nop>SERVERTIME{$epoch}%= in an edit link. This is done to prevent browsers from caching an edit session, which could result in editing outdated content. The parameter name and value is arbitrary, but must be unique each time. | | Form field values are passed in parameters named 'field' - for example, if I have a field =Status= the parameter name is =Status=. @@ -149,7 +160,7 @@ | *Parameter* | *Description* | *Default* | | =text= | Text of the topic | '' | | =originalrev= | Revision that the edit started on | Most recent revision | -| =redirectto= | If the savesettings process is successful, save will redirect to this topic or URL. The parameter value can be a =TopicName= or a =Web.TopicName= (optionally with parameters e.g. =FooBar?param1=value1=), or a URL.%BR% __Note:__ Redirect to a URL only works if it is enabled in =configure= (Security setup > Miscellaneous ={AllowRedirectUrl}=). | | +| =redirectto= | If the savesettings process is successful, save will redirect to the topic or URL specified by this parameter. Please read [[#RedirecttoParameter][here]] for details. | | All other parameters may be interpreted as form fields, depending on the current form definition in the topic. #ActionBulkRegister @@ -248,7 +259,7 @@ | =confirm= | if defined, requires a second level of confirmation | | | =currentwebonly= | if defined, searches current web only for links to this topic | | | =nonwikiword= | if defined, a non-wikiword is acceptable for the new topic name | | -| =redirectto= | If the rename process is successful, rename will redirect to this topic or URL. The parameter value can be a =TopicName= or a =Web.TopicName= (optionally with parameters e.g. =FooBar?param1=value1=), or a URL.%BR% __Note:__ Redirect to a URL only works if it is enabled in =configure= (Security setup > Miscellaneous ={AllowRedirectUrl}=). | | +| =redirectto= | If the rename process is successful, rename will redirect to the topic or URL specified by this parameter. Please read [[#RedirecttoParameter][here]] for details. | | | =disablefixlinks= | Bypass fixing !WikiWord links in the rename destination topic if rename is done across webs. Fixing links in the renamed topic such as from !SomeLink to !Otherweb.SomeLink is usually desirable so that links in the copied topic still point to the same target | =off= (links are fixed) | __Note:__ The =rename= script can only be called via http POST method, not GET. Make sure you specify =method="post"= if you call the =rename= script via a form action. @@ -262,7 +273,7 @@ | =newweb= | destination web name | current web | | =newtopic= | destination topic name | current topic | | =nonwikiword= | if defined, a non-wikiword is acceptable for the destination topic name | | -| =redirectto= | If the copy process is successful, copy will redirect to this topic or URL. The parameter value can be a =TopicName= or a =Web.TopicName= (optionally with parameters e.g. =FooBar?param1=value1=), or a URL.%BR% __Note:__ Redirect to a URL only works if it is enabled in =configure= (Security setup > Miscellaneous ={AllowRedirectUrl}=). | | +| =redirectto= | If the copy process is successful, copy will redirect to the topic or URL specified by this parameter. Please read [[#RedirecttoParameter][here]] for details. | | | =overwrite= | By default, copy does not happen if the destination topic already exists. If this parameter is ='on'=, the destination topic is deleted if exists before copying takes place | =off= (no overwrite) | | =disablefixlinks= | Bypass fixing !WikiWord links in the copy destination topic if copy is done across webs. Fixing links in the copied topic such as from !SomeLink to !Otherweb.SomeLink is usually desirable so that links in the copied topic still point to the same target | =off= (links are fixed) | @@ -330,14 +341,13 @@ | =originalrev= | Revision on which the edit started. | | | =edit= | The script to use to edit the topic when action is =checkpoint= | =edit= | | =editparams= | The parameter string to use to edit the topic | | -| =redirectto= | The save process will redirect to this topic or URL if it is successful. (Typically this would be the URL that was being viewed when edit was invoked). The parameter value can be a =TopicName= or a =Web.TopicName= (optionally with parameters e.g. =FooBar?param1=value1=), or a URL.%BR% __Note:__ Redirect to a URL only works if it is enabled in =configure= (Security setup > Miscellaneous ={AllowRedirectUrl}=). | view topic being saved | +| =redirectto= | The save process will redirect to the topic or URL specified by this parameter if it is successful. Please read [[#RedirecttoParameter][here]] for details. Please read notes on =redirectto= below as well. | view topic being saved | __%X% Notes:__ * Any errors will cause a redirect to an =oops= page. * It is possible to get auto-incremented topic names: Add =AUTOINC<n>= (such as =AUTOINC0001=, =<n>= being one or more consecutive digits) to the topic name; it will be converted to a number to make a unique topic name in the web. For example, =ItemAUTOINC0001= makes =Item0001=, =Item0002=, =Item0003=, ... ([[TWikiTemplates#AutomaticallyGeneratedTopicname][detail]]) - * After the save operation, the web client is redirected to the newly created topic by default. If the specified topic name contains =AUTOINC<n>= and you want to redirect to a different URL containing the newly created topic's name, you can use =AUTOINC= in the =redirectto= parameter. Let's say the specified topic name is =ItemAUTOINC0001=, and =redirectto= is set to <code>%<nop>SCRIPTURL{view}%/%<nop>WEB%/ViewerTopic?id=ItemAUTOINC</code>. If the latest existing topic is =Item0123=, a new topic named =Item0124= is created, and the web client is redirected to =ViewerTopic?id=Item0124= in the current web. * When the action is =save=, =checkpoint=, =quietsave=, or =preview=: 1 The new text is taken from the =text= parameter, if it is defined, @@ -361,6 +371,12 @@ %BR% =<nop> ...= %BR% =</form>= + * There are two things to mention about the =redirectto= parameter. + * You may create a new topic name containing =AUTOINC<n>= and you may want to redirect to a URL containing the newly created topic's name. + This is tricky but you can achieve that by putting =AUTOINC= in the =redirectto= parameter. + Let's say you create new topics by specifying =ItemAUTOINC000= as the topic name, then =ItemAUTOINC= in =redirectto= is replaced with the appropriate ItemNNN. For example, if the latest existing topic is =Item012=, a new topic named =Item013= is created, and the web client is redirected to a URL having =Item013=. + * When the "Quiet save" button is clicked, TWiki processes as if the =dontnotify= field has the value =checked=. + #SearchScript ---+++ =search= |