At 10:32 PM 10/26/01 -0700, Craig Barratt wrote:
>>         my $count = 1;
>
>This should probably be my $count = 0;

Thanks for catching that -- I had changed it in the wrong window...


>
>>         $text =~ s[<h2>(.+?)</h2>][replace_tags( $context, $1, $count++
)]gie
>> ;
>
>You might want to add "s" to "gie" to handle multi-line headings (but
>your hrefs and tags will need to be fixed too).  You might want to
>ignore optional attributes too...

I'll probably use HTML::Parser, but I wanted something quick for testing.
Thanks also.


>The remaining problem likely has to do with localization of the stash.
>INCLUDE (and WRAPPER) localize the stash, meaning a local copy of the
>top level is made, and then restored when the INCLUDEd template is
>finished.

Ok.  Seems like that might be the problem as I can't even set a simple
variable in the stash and get it to print.

in .ttreerc I set process = wrapper

>cat wrapper
[% USE SubMenu %]

    [% WRAPPER page;
           PROCESS $template FILTER submenu;
       END
    %]

And "page" does [% PROCESS menu %].  But that shouldn't be localizing, right?

It's interesting.  I first got the menu stuff working by adding this to the
top of the source file.  But when I set the stash in the filter (and leave
this structure in) my generated tags look like:

    * <a href=""></a><br>

So, the stash is clearing my "sections" data structure, but not replacing it.

  [% sections = [
     {
        href = '#hello1'
        text = 'sub heading one'
     },
     {
        href = '#hello2'
        text = 'sub heading two'
     }
  ] %]



>Here's a quick test: add something this at the top:
>
>    [% sections = []; %]

Well, I already have a sections in my source file, so maybe that's not the
problem?

>Also, I find the Dumper plugin is a great way to debug these kinds
>of things since you can print out variables at various points to
>make sure everything is ok.

Is there a way to dump everything that's currently in scope?

Thanks very much for your help!



Bill Moseley
mailto:[EMAIL PROTECTED]


Reply via email to