[Petal] [rfc] if: ... then: ... else: ... modifier

Jean-Michel Hiver jhiver at mkdoc.com
Thu Sep 11 13:28:12 BST 2003


> <a
>   petal:attributes="class if: search_page then: string: nav-selected else: string: nav-unselected"
>   href="/search.html" class="nav">Search</a>

Why not :)

Note that you could do the same as above as follows:

<a petal:condition="true:search_page"
   href="/search.html"
   class="nav-selected">Search</a>

<a petal:condition="false:search_page"
   href="/search.html"
   class="nav-unselected">Search</a>

Which achieves the same thing albeit in a less WYSIWYG-friendly way.
Cheers,
-- 
Building a better web - http://www.mkdoc.com/
---------------------------------------------
Jean-Michel Hiver
jhiver at mkdoc.com  - +44 (0)114 255 8097
Homepage: http://www.webmatrix.net/


More information about the Petal mailing list