APM: Framework help: Can HTML::Template do this? If not, what CPAN module can?

Wayne Walker wwalker at bybent.com
Thu Sep 8 15:16:26 PDT 2005

You can do this with TMPL_IF and TMPL_INCLUDE
  <tmpl_if name=calendar_present>
    <tmpl_include name="path/to/cal.js">
  <tmpl_if name=calendar_present>
    <div .....>

This requires that you set calendar_present=1 in the calling program.

Since I'm not sure what decides if the calendar ends up in the
container, I can't guess further

On Thu, Sep 08, 2005 at 04:58:52PM -0500, Bill Raty wrote:
>    I'm trying not to reinvent the wheel, but I'm having difficulty determining
>    if the wheel I'm needing has been invented.
>    I've looked at HTML::Template POD, and I get the basic concept.  In my
>    ignorance I'm failing to see how I can apply it to my problem, and ifthere
>    are other CPAN modules that are better suited to my task.
>    I want to have a DWIMy page component system so that page controls can be
>    called out and "Do The Right Thing".  Example:
>    I  have  a  calendar  input  widget set that  requires pieces of HTML,
>    JavaScript, and CSS, which need to be exposed in the container page; a
>    script tag in the "head",  a 'div' that needs to appear early on inside the
>    "body" tag, and the 'input' tag that has event handlers that usethe earlier
>    script tag.
>    I'd like a system that abstract the container page, that lets me develop the
>    calendar control component as if it were the containing page, but when
>    added/included/embedded in the container page the system smartly places the
>    control component elements in the correct part of the containing page.  The
>    clincher is the second add of the calendar widget doesn't duplicate the
>    'script' and 'div' tags, but only interjects the 'input' tag for the second
>    control.

> _______________________________________________
> Austin mailing list
> Austin at pm.org
> http://mail.pm.org/mailman/listinfo/austin


Wayne Walker

wwalker at bybent.com                    Do you use Linux?!
http://www.bybent.com                 Get Counted!  http://counter.li.org/
Perl - http://www.perl.org/           Perl User Groups - http://www.pm.org/
Jabber:  wwalker at jabber.gnumber.com   AIM:     lwwalkerbybent
IRC:     wwalker on freenode.net

More information about the Austin mailing list