I've found another interesting inflection point is the 'associate'
parameter given to the template constructor.   Associate
tells the template that another object has a 'param' method that acts
like the one in CGI.pm: called with args its a setter, called without
args in a list context returns a list of parameter names that are
provided by the object.  Thus the code using the template can do
some passive relection of templates by making a crafty 'param' method.<br>
<br>
I'll send out examples if I'm able to cobble up anything promising.<br>
<br>
Meanwhile, thanks again Austin Mongers!<br>
<br>
-Bill<br><br><div><span class="gmail_quote">On 9/8/05, <b class="gmail_sendername">Bill Raty</b> &lt;<a href="mailto:bill.raty@gmail.com">bill.raty@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Wayne.<br>
<br>
Aha!&nbsp; I may get away with it using the 'filters'.&nbsp; Also the special loop vars look promising:<br>
<br>
<br>
<pre>&lt;TMPL_LOOP NAME=&quot;FOO&quot;&gt;<br>      &lt;TMPL_IF NAME=&quot;__first__&quot;&gt;<br>        This only outputs on the first pass.<br>      &lt;/TMPL_IF&gt;<br><br>      &lt;TMPL_IF NAME=&quot;__odd__&quot;&gt;
<br><br>        This outputs every other pass, on the odd passes.<br>      &lt;/TMPL_IF&gt;<br><br>      &lt;TMPL_UNLESS NAME=&quot;__odd__&quot;&gt;<br>        This outputs every other pass, on the even passes.<br>      &lt;/TMPL_IF&gt;
<br><br><br>      &lt;TMPL_IF NAME=&quot;__inner__&quot;&gt;<br>        This outputs on passes that are neither first nor last.<br>      &lt;/TMPL_IF&gt;<br><br>      This is pass number &lt;TMPL_VAR NAME=&quot;__counter__&quot;&gt;.
<br><br><br>      &lt;TMPL_IF NAME=&quot;__last__&quot;&gt;<br>        This only outputs on the last pass.<br>      &lt;TMPL_IF&gt;<br><br><br>   &lt;/TMPL_LOOP&gt;</pre>
<br>
It still seems to require that the template writer to know too much about inclusions or adhere to a convention.<br><span class="sg">
<br>
-Bill</span><div><span class="e" id="q_10638c17c5e9b887_2"><br>
<pre><br></pre>
<br>
<br>
<br><br><div><span class="gmail_quote">On 9/8/05, <b class="gmail_sendername">Wayne Walker</b> &lt;<a href="mailto:wwalker@bybent.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">wwalker@bybent.com
</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You can do this with TMPL_IF and TMPL_INCLUDE<br>&lt;head&gt;<br>&nbsp;&nbsp;&lt;tmpl_if name=calendar_present&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tmpl_include name=&quot;path/to/cal.js&quot;&gt;<br>&nbsp;&nbsp;&lt;/tmpl_if&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>

stuff<br>&nbsp;&nbsp;&lt;tmpl_if name=calendar_present&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;div .....&gt;<br>&nbsp;&nbsp;&lt;/tmpl_if&gt;<br>&lt;/body&gt;<br><br>This requires that you set calendar_present=1 in the calling program.<br><br>Since I'm not sure what decides if the calendar ends up in the
<br>container, I can't guess further<br><br><br>On Thu, Sep 08, 2005 at 04:58:52PM -0500, Bill Raty wrote:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;I'm trying not to reinvent the wheel, but I'm having difficulty determining<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;if the wheel I'm needing has been invented.
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;I've looked at HTML::Template POD, and I get the basic concept.&nbsp;&nbsp;In my<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;ignorance I'm failing to see how I can apply it to my problem, and ifthere<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;are other CPAN modules that are better suited to my task.
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;I want to have a DWIMy page component system so that page controls can be<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;called out and &quot;Do The Right Thing&quot;.&nbsp;&nbsp;Example:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;&nbsp;have&nbsp;&nbsp;a&nbsp;&nbsp;calendar&nbsp;&nbsp;input&nbsp;&nbsp;widget
set that&nbsp;&nbsp;requires pieces of HTML,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;JavaScript, and CSS, which need to be exposed in the container page; a<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;script tag in the &quot;head&quot;,&nbsp;&nbsp;a 'div' that needs to appear early on inside the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&quot;body&quot; tag, and the 'input' tag that has event handlers that usethe earlier
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;script tag.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;I'd like a system that abstract the container page, that lets me develop the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;calendar control component as if it were the containing page, but when<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;added/included/embedded in the container page the system smartly places the
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;control component elements in the correct part of the containing page.&nbsp;&nbsp;The<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;clincher is the second add of the calendar widget doesn't duplicate the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;'script' and 'div' tags, but only interjects the 'input' tag for the second
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;control.<br><br>&gt; _______________________________________________<br>&gt; Austin mailing list<br>&gt; <a href="mailto:Austin@pm.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Austin@pm.org
</a><br>&gt; <a href="http://mail.pm.org/mailman/listinfo/austin" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mail.pm.org/mailman/listinfo/austin</a><br><br>--<br><br>Wayne Walker<br><br><a href="mailto:wwalker@bybent.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">wwalker@bybent.com</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do
you use Linux?!<br><a href="http://www.bybent.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.bybent.com</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Get Counted!&nbsp;&nbsp;<a href="http://counter.li.org/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://counter.li.org/</a><br>Perl - <a href="http://www.perl.org/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.perl.org/</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Perl User Groups - <a href="http://www.pm.org/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.pm.org/</a>
<br>Jabber:&nbsp;&nbsp;<a href="mailto:wwalker@jabber.gnumber.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">wwalker@jabber.gnumber.com</a>&nbsp;&nbsp; AIM:&nbsp;&nbsp;&nbsp;&nbsp; lwwalkerbybent<br>IRC:&nbsp;&nbsp;&nbsp;&nbsp; wwalker on <a href="http://freenode.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
freenode.net</a><br>_______________________________________________
<br>Austin mailing list<br><a href="mailto:Austin@pm.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Austin@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/austin" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mail.pm.org/mailman/listinfo/austin</a><br></blockquote></div><br>

</span></div></blockquote></div><br>