Question
I have some variables in perl script. I want to pass these variables as parameters to a topic. I know that this can be passed to a template.
Is there a way to do this? Please explain.
- TWiki version: TWiki20030201
- Perl version: 5.8
- Web server & version: 1.3.27
- Server OS: Windows XP
- Web browser & version: IE 6.0
- Client OS: Windows XP
--
SampturUmashankar - 28 May 2003
Answer
Not sure I understand your question. You can pass any variable to a TWiki topic as a URL paramter, e.g.
.../bin/view/Web/TopicName?anyparam=ok, then display that in the topic using the
%URLPARAM{}% variable, e.g.
%URLPARAM{"anyparam"}%. An example in action is
TWikiInstallations.
If you have a variable in a Plugin to display, you can introduce a new variable in the Plugin's
commonTagsHandler callback routine. See
TWikiPlugins for more.
--
PeterThoeny - 29 May 2003
Hello Peter,
Thanks very much. It worked. When I pass the variable as suggested by you, it can be seen in the address bar of the browser. Is there a way to hide it?
If you don't mind, I have more question, Can I pass more than one variable to a Twiki topic?
Regards,
Umashankar - 28 May 2003
--
SampturUmashankar - 28 May 2003
Hide parameters: In the HTML form you could use
method="post" instead of
method="get".
Multiple parameters:
.../bin/view/Web/TopicName?anyparam=ok&param2=etc, then write
%URLPARAM{"anyparam"}%,
%URLPARAM{"param2"}%
--
PeterThoeny - 29 May 2003
Hello Peter,
Thanks very much.
Regards,
Umashankar
--
SampturUmashankar - 30 May 2003