>>>>> "HdV" == HdV  <[EMAIL PROTECTED]> writes:

HdV> Is there a method by which I can read the META variables set in the
HdV> calling template from the plugin without having to explicitly pass them
HdV> as parameters? I'd like to modify the behaviour of the plugin if a
HdV> certain variable is set. Right now I have an optional named variable
HdV> that can be given to the plugin constructor, but it would be more
HdV> convenient to the users if the plugin would somehow be able to figure
HdV> out for itself if this variable is set or not. (I am talking about
HdV> document dependend locales in this case.)

Presuming that "component" is set in the stash during your constructor
(at the time of "USE"), you should be able to grab "component.foobar"
to refer to "META foobar = ...".  Something like:

    sub new {
      my $class = shift;
      my $context = shift;

      if (my $foobar = $context->stash->get("component.foobar")) {
        ..
      }
      bless { ... }, $class;
    }

Untested, but the docs lead me to believe this, and I'd start there.

HdV> P.S. Randal I finally read your "meta sitemap extractor" solution. It
HdV> certainly was enlightening to read for this newbie. As soon as I have
HdV> finished this plugin business I am going to try to adapt that concept to
HdV> something I can use for my project.

Thanks.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to