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 - 2005-06-07 - SusanneRuppel
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.