On Dec 24 Peter Scott wrote:

[Apologies if this is no longer relevant; I've only got your mail this
morning.]

> This is arguably not a HTML::Template question but since not many
> people besides HTML::Template users will have encountered this
> situation I will ask here.

Sounds like an HTML::Template question to me!

> I have a lot of template code like
>
>       <OPTION <TMPL_IF NAME=foo>SELECTED</TMPL_IF>>Foo</OPTION>
>
> (DreamWeaver) does not like this syntax, and persists in changing it
>
> I can see two choices, equally unpleasant:
>
> (1) Get customer to use another HTML editor.  Only choice appears to
> be emacs/vi.  Customer will detest this option.
>
> (2) Have my application output the whole <OPTION> tag via a <TMPL_VAR>
> instead of just the SELECTED attribute.
>
> Has anyone else encountered this situation and found a third solution?

Yup.  I use 'Vim' which (being a souped-up 'Vi') obviously does permit
typing nested tags but which highlights them as an error.  My
work-around is to use something else as the brackets on such
HTML::Template tags.  I like the double-angled brackets found in
Latin-1, since they don't normally appear elsewhere in HTML:

  <OPTION «TMPL_IF NAME=foo»SELECTED«/TMPL_IF»>Foo</OPTION>

Then you just need to write a simple filter to pass to HTML::Template
which globally replaces whichever symbols you chose with the standard
less- and greater-than signs:

  sub FixUpBrackets
  {
    my ($template) = @_;
    $$template =~ tr/«»/<>/;
  }

  my $page = HTML::Template->new(filename => 'feedback.tmpl',
      filter => \&FixUpBrackets);

Smylers
-- 
GBdirect
http://www.gbdirect.co.uk/



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to