I have a several question about variables in PHPTAL templates:

1) How to put phptal variable to string. Here is code. I want to get
variable nestedItem['m_obrazek'] to property onclick.
is not working.

<span tal:repeat="item picturesList">
           <a href="#">
           <img tal:repeat="nestedItem item"
                 tal:attributes="src php: '
http://example.org/script.php?pictureName=<HERE VARIABLE
                           document.getElementById('imgBox').onclick =
function() { window.open('someScript.php','') } ;"

2) Similar problem in other source code. I have a PHPTAL variable called
"language" and I need to fetch into string like in PHP "poznamka_$language".
But how in PHPTAL?

<div id="MText" tal:condition="php: language != 'cz'" tal:repeat="item
itemsList" tal:content='structure
      Sed ut perspiciatis unde omnis iste natus error sit voluptatem
accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab
illo inventore veritatis et quasi

3) It's all about the same. I need to fetch PHPTAL variable... please see
below and HERE PHPtal variable :)

<a href="#"><img name="imageBox" src="${path}/images/budova.jpg" id="imgBox"
tal:attributes="src php: picturesList[<HERE PHPTAL variable>][HERE PHPTAL
variable]" /></a> </div>

I hope it is clear I am currently struggling with PHPTAL syntax, especially
around variables. Anyway, great piece of software!

thanks a lot.
PHPTAL mailing list

Reply via email to