For example if I was to use this button, button onclick="window.location.href='page.html'"
If I use tal:attributes or tal:define how am I able to escape the double qoutes? I tried the single backslash but it's throwing syntax error. What I tried.
Are we allowed to use variables with path string?
What if my href is tal:define="href1 python:'?opflag=edit&category=%s&cat_id=%d&physical_name=%d' %(category,cat_id,physical_name);"
And I want tal:define="path string:window.location.href='%s' % href1"
Which would then be used for button tal:attributes="onclick path"
Slightly off topic, but there is hardly any need for using 'tal:attributes' anymore:
Usually, you can just do
<a href='${python: path}'
(and similar with 'other stuff, like:
<img alt="${context/Description}" ....
UPDATE: I just used python:path since it was in the question, probably no need here. You might also consider doing all the 'calculations' in a browserview.py - file , and use