SCRIPTURL{"script"} -- URL of TWiki script
- Expands to the URL of the specified script. Optionally, you can specify a web and/or a topic. In that case, the URL of the script for the specified web and topic is returned.
- If ReadOnlyAndMirrorWebs is in effect and a web is specified, whether the web is a slave or not is taken into account. For a slave web, with scripts
edit
,save
,attach
,upload
, andrename
, the URL on the master site is returned.
For the other scripts, if themaster="on"
parameter is specified, the URL on the master site is returned. - Syntax:
%SCRIPTURL{"script" ...}%
- Supported parameters:
Parameter: Description: Default: "script"
The name of the script web="WEB"
Specifies a web When a topic name is specified and a web is not, the current web is assumed topic="TOPIC"
ortopic="WEB.TOPIC"
Specifies a topic or both a web and a topic master="on"
A URL on the master site is needed or not off
- If
web="WEB"
is specified buttopic
is not specified, the resulting URL ends withWEB
. - Example: To get the authenticated version of the current topic you can write
%SCRIPTURL{"viewauth"}%/%WEB%/%TOPIC%
which expands tohttps://junobase.com/do/viewauth/TWiki/VarSCRIPTURL2
. It can be written%SCRIPTURL{"viewauth" topic="%TOPIC%"}%
as well. - Example: Let's assume this site has a web named 'Flowers' whose master site is
http://florawiki/cgi-bin
. Then%SCRIPTURL{"edit" web="Flowers"}%
expands tohttp://florawiki/cgi-bin/edit/Flowers
. This is because the 'Flower' web on this site is a slave and editing needs to happen on the master site. - Example: Asuming above,
%SCRIPTURL{"view" web="Flowers" master="on"}%
expands tohttp://florawiki/cgi-bin/view/Flowers
. Theview
script works on a slave site, butmaster="on"
parameter forces to yield the master site URL. - Example: How to link to another topic with a URL parameter:
[[%SCRIPTURL{view}%/%WEB%/MyQuery?food=sushi][Sushi]]
- Note: In most cases you should use
%SCRIPTURLPATH{"script"}%
instead, as it works with URL rewriting much better - Category: DevelopmentVariables, SystemInformationVariables
- Related: CONTENTMODE, PUBURL, SCRIPTNAME, SCRIPTSUFFIX, SCRIPTURL, SCRIPTURLPATH, SCRIPTURLPATH{"script"}, SITENAME, ReadOnlyAndMirrorWebs, MetadataRepository, TWikiScripts