[Zope-CMF] ZPT and stylesheets again!

Arnar Lundesgaard arnar.lundesgaard@creuna.no
Fri, 18 Jan 2002 16:37:28 +0100


Hi,=20

First, the "tal:condition"-statement decides whether the element=20
should be included, not if it should perform the "tal:attributes"=20
statement.

Second, this example works for me.

<link rel=3D"stylesheet" href=3D"dw_stylesheet.css" type=3D"text/css"
      tal:attributes=3D"href python: path('here/ttw_editing')
                      and path('here/zpt_stylesheet/absolute_url')
                      or path('default')">

You can use 'here.ttw_editing' instead of path(...).

 - Arnar Lundesgaard

-------------------------------
Creuna as
Bryggegata 3
NO-0250 Oslo
phone office: (+47) 23 23 88 00
fax: (+47) 23 23 88 50
http://www.creuna.no


> -----Original Message-----
> From: Jon Edwards [mailto:jon@pcgs.freeserve.co.uk]
> Sent: 18. januar 2002 15:36
> To: Zope-Cmf
> Subject: [Zope-CMF] ZPT and stylesheets again!
>=20
>=20
> Sorry to bring this up here again, but I'm getting no replies from the =
ZPT
> list, so I thought I'd try a different approach.
>=20
> In the head of main_template I put -
>=20
>  <link rel=3D"stylesheet" href=3D"dw_stylesheet.css"
>        type=3D"text/css"
>        tal:condition=3D"here/ttw_styleedit"
>        tal:attributes=3D"href here/zpt_stylesheet/absolute_url">
>=20
> - my (limited) understanding of ZPT is that if the boolean-property
> "ttw_styleedit" is true, the href would be
> "here/zpt_stylesheet/absolute_url", if it's false, it would ignore the
> tal:attributes bit and leave the href as "dw_stylesheet.css"
>=20
> It replaces the href if ttw_styleedit is true, but if it's false, it =
omits
> the whole <link> tag - just a blank space
>=20
> I also tried tal:condition=3D"here/ttw_styleedit|default", but that =
made no
> difference
>=20
> I can get round it by putting two <link> tags in the head, with =
different
> conditions, but that might confuse people editing via Dreamweaver. Can
> anyone point me in the right direction please?
>=20
> Cheers, Jon
>=20