TWiki needs a function for script urls
Currently, if people want to have a clickable link that does something to a topic, they have to handcraft it, like
<a href="%SCRIPTURLPATH%/action%SCRIPTSUFFIX%/%WEB%/%TOPIC%?params">. This is also the case in the TWiki code.
I think that there should be a function, TWiki::scriptUrl(action,web,topic,params), that generates the url, and it should be accessible as a
TWikiVariable too:
%SCRIPTURL{action="foo" topic... web=... params=...}%=, where action is the only required argument.
Apart from making it easier for the users and coders, this also makes it easier to implement
ShorterURLs, because the function could make a special case of the "view" action and serve a shorter url for that.
--
WoutMertens - 21 Aug 2002
Hmm, do href's have to be:
- A fully specified URL starting with a connection method http:, telnet: etc
or
- A relative URL starting with a /
If so, then expanding interwiki link syntax in href's would be a good thing to do.
Then you just do href="SearchCodev:some%20search%20term".
Maybe with some magic to specify interwiki links as regexps so that Search(.*) becomes
https://www.twiki.org/cgi-bin/search/$1?search="$page". This way
SearchPlugins:... SearchSupport:... all come out in the wash, and
Search__Webname__ can be automatically used for any web.
Only the interwiki link creator would have to deal with the complex stuff, and
s/he would only have to do it once.
--
JohnRouillard - 21 Aug 2002
Unless I'm getting confused ...
A relative URL is one that doesn't start with a /
A / refers to the top level of the machine e.g.
--
JohnTalintyre - 22 Aug 2002