Re: [Templates] pre/post chomp question....
[prev]
[thread]
[next]
[Date index for 2004/12/13]
--rQ2U398070+RC21q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
* Sean T Allen <sean at usaherbals.com> [2004/12/13 11:48]:
> if i have the following at the start of a template:
>=20
> [%- DEFAULT
> mc =3D 'WPJF1'
> -%]
> [%- IF mc =3D=3D 'WPJF1' -%]
> [%- SET shipping =3D '4.95' -%]
> [%- ELSIF mc =3D=3D 'WPJF4' -%]
> [%- SET shipping =3D '2.95' -%]
> [%- END -%]
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>=20
>=20
> shouldnt this remove all whitespace and newlines proceeding the doctype=
=20
> line?
You could just do it like this:
[%- DEFAULT
mc =3D 'WPJF1';
IF mc =3D=3D 'WPJF1';
SET shipping =3D '4.95';
ELSIF mc =3D=3D 'WPJF4';
SET shipping =3D '2.95';
END;
-%]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
This way, there is no chance of whitespace slipping through. Plus,
it's a little easier to read.
(darren)
--=20
When correctly viewed, everything is lewd.
-- Tom Lehrer
--rQ2U398070+RC21q
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQFBvhN2zsinjrVhZaoRAopeAKCAnrqWPpClIrouhbHjDyUquutxCACgi/Fm
hGZlKfzaF78JcI9CNdKMZGo=
=1mwj
-----END PGP SIGNATURE-----
--rQ2U398070+RC21q--
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
 |
Re: [Templates] pre/post chomp question....
Darren Chamberlain 22:11 on 13 Dec 2004
|