I have looked at the H::T list archives, and cannot find an answer other
than "I think it can be done with callbacks".  As an aside - what is the
new host of the H::T list?  I only get a response from mailer-daemon at
vanguard.

I would like to represent a hierarchical structure using a recursive
Template.  For example:

$template->param(
      sub => [
            {
                  title => 'foo',
                  url => 'foo.html',
                  sub => [
                        {
                              title => 'foo-1',
                              url => 'foo-1.html',
                        },
                        {
                              title => 'foo-2',
                              url => 'foo-2.html',
                              sub => [...],
                        },
                  ],
            },
            {
                  title => 'bar',
                  url => 'bar.html',
            },
      ]
);

I would like to represent it like this...

<UL>
      <LI>
            <A HREF="foo.html">foo</A>
            <UL>
                  <LI>
                        <A HREF="foo-1.html">foo-1</A>
                  </LI>
                  <LI>
                        <A HREF="foo-1.html">foo-2</A>
                        <UL>...</UL>
            </UL>
      </LI>
      <LI>
            <A HREF="bar.html">bar</A>
      </LI>
</UL>

Now, if I do something like this....

<!-- recurse.tmpl -->
<TMPL_IF NAME="sub">
      <UL>
      <TMPL_LOOP NAME="sub"><LI>
            <A HREF="<TMPL_VAR NAME="url">"><TMPL_VAR NAME="title"></A>
            <TMPL_INCLUDE NAME="recurse.tmpl">
      </TMPL_LOOP>
      </UL>
</TMPL_IF>

I get a recursion too deep message.  It looks like the template is
generating the include before replacing any variables.

Does anyone have any working code they are willing to share which
accomplishes something like this?  Just asking before I go off and
implement it on my own.

Thanks,
Brian
----
Brian T. Wightman
[EMAIL PROTECTED]
414.524.4025


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to