Hi!

I'm using in my template two macros - 'content' and 'js' (block with
javascript code).

main.html:
<?xml version="1.0"?>
<html>
<head>
.....
# thanks to on-error="" even if in some template there is only 'content'
macro (without 'js' macro), <script></script> isn't added to code (thanks
for kornel for this idea ;) ).
<script tal:on-error="" metal:use-macro="sites/${site}.html/js"/>
</head>
<body>
......
<div metal:use-macro="sites/${site}.html/content"></div>
.....
</body>
</html>

example_template.html:
<?xml version="1.0"?>
<script type="text/javascript" metal:define-macro="js">
......(javascript code).....
</script>
<div metal:define-macro="content">
....(content)....
</div>

And now, when I want to use sings like < or > in js code, I write:

if(count<x tal:replace="structure '<'"/>3)

(otherwise xml parsing will return an error)
This is a bit uncomfortable in use - is there some other, better way to use
< > signs in templates as text?
I tried with entities, but they aren't replacing by their equivalent signs
in html.

cheers!
szymek
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to