We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
Tags:
create new tag
, view all tags

Question

Hello!

I want to read in a Template via readTemplate (TWikiFuncModule#readTemplate_name_skin_text) in a Plugin. The Template contains only two variable definitions, a table header and a sample table row (since I want to keep design and language stuff out of the code).
How can I access my two variables?

The Documentation (TWikiTemplates) says: Variables live in a global name space: there is no parameter passing. But I've no idea, how to access them (variable name, key).
Does anybody know?

Of course I can put it back into the Plugin, or write some kind of workaround using one of the other TWiki::Func::read* functions, but I think a template would suite best.
Or am I wrong?

Thank you!

Susanne

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Debian testing/unstable, kernel 2.6.10
Web server: apache 1.3
Perl version: 5.8.4
Client OS: Debian testing/unstable, kernel 2.6.11
Web Browser: Opera, Firefox, Mozilla
Categories: Plugins

-- SusanneRuppel - 28 May 2005

Answer

I think I found the recommended way: TWikiPlugins#Where_to_store_Plugin_Internal_D.

-- SusanneRuppel - 28 May 2005

If you just want to store variables persistently it is easier to define Plugin variables in your Plugin topic, e.g.

  • Set SAMPLE_HEADER = |*Foo*|*Bar*|

You can access that in any topic and in any template as %MYOWNPLUGIN_SAMPLE_HEADER%

-- PeterThoeny - 29 May 2005

I had to fill out the variables in a kind of template with dynamic content (like the TWiki engine does), so the Plugin settings didn't help (but I have a bunch of them :-). The TWikiPlugins#Where_to_store_Plugin_Internal_D way worked very fine for me.
Thank you!

-- SusanneRuppel - 07 Jun 2005

 
Topic revision: r4 - 07 Jun 2005 - 07:24:04 - SusanneRuppel
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback