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 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

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2002-08-22 - JohnTalintyre
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.