in reply to Re: Sticky HTML Templates
in thread Sticky HTML Templates

Please expand on this.

Replies are listed 'Best First'.
(Ovid) Re(3): Sticky HTML Templates
by Ovid (Cardinal) on Oct 25, 2001 at 22:37 UTC

    I'm playing with this now. Here's what I have:

    <textarea cols="45" rows="3" name="event"></textarea>

    This becomes:

    [% USE CGI %] <textarea cols="45" rows="3" name="event">[% CGI.param('event') %] +</textarea>

    It performs as advertised, but doesn't escape any of the HTML characters, so typing </textarea> in the textarea will break it. It appears that the HTML plugin can fix this, but I don't have that installed (yet).

    I'm going to have to give this some thought. It's a quick and easy way to make some things sticky, but I don't see how it would work with a select group, for example. I'll second your request to have masem expand on this :)

    Update: Hmm... I see what masem is doing, but that kind of defeats part of what I need: a simple, easily maintainable template that our designers can go into a work on. Interesting, though.

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

      It performs as advertised, but doesn't escape any of the HTML characters, so typing </textarea> in the textarea will break it. It appears that the HTML plugin can fix this, but I don't have that installed (yet).

      Looks like TT2 do need "escaping expressions" feature that exists in HTML::Mason for so long: you can add one or several escape flags at the end of expression to be expanded. <% $text_that_should_be_escaped |h%> will do exactly what you want - escape all special HTML-entities. Morover, you can customize default escape flags to avoid writing them everywhere or to change behaviour of existing components.

      -- brother ab