Hi, 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. ${nestedItem['m_obrazek']} 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='.nestedItem['n_obrazek']" border="0" onclick="imageBox.src=' http://example.org/script.php?pictureName=<HERE VARIABLE nestedItem[m_obrazek]>'; document.getElementById('imgBox').onclick = function() { window.open('someScript.php','') } ;" /></a> </span> 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 php:nl2br(htmlspecialchars(item["poznamka_${language}"]))'> 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 <div> 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 PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal