Tags:
create new tag
, view all tags

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 http://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

Topic revision: r3 - 2002-08-22 - 07:59:00 - JohnTalintyre
 

Codev

share: Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon
Twiki, Inc.
This site is powered by the TWiki collaboration platform
Ideas, requests, problems regarding TWiki? Send feedback
Copyright © 1999-2010 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.