I am new to ZPTs, but recently have becomed involved with them. I am familiar with DTML and want to make similar functionality using "TAL". In the past , my group has made use of the <dtml-var> method to call strings from a folder to be used in image links, hyperlinks, etc. The main reason we use this <dtml-var> is because we have sites running in a development environment that are then moved to production. To make this move seamless, we create variables in the "properties" tab at the site root. For example, the variable string we create in the "properties" tab in the ZMI may have a value of: /devsiteFolder/images/ and be called, "imageDir". This variable is then used to call an image throughout the site using <img src="/<dtml-var imageDir>/imageName.gif"> When the site is moved to production, we change the string /devsiteFolder/images/ to /productionsiteFolder/images. Very simple, yet I cannot find good documentation on how to convert this to TAL if I wanted to use this inside a Page Template...Please Help I have read and re-read the current documentation and articles relating to "DTMLers learning TAL" and I must say the syntax is what has me most confused. A simple chart with sample TALES and its common functions would be a great help. Thank you, Ryan --
On Wed, Nov 26, 2003 at 08:50:05AM -0800, Kevin Rosso wrote:
I am new to ZPTs, but recently have becomed involved with them. I am familiar with DTML and want to make similar functionality using "TAL". In the past , my group has made use of the <dtml-var> method to call strings from a folder to be used in image links, hyperlinks, etc. The main reason we use this <dtml-var> is because we have sites running in a development environment that are then moved to production. To make this move seamless, we create variables in the "properties" tab at the site root. For example, the variable string we create in the "properties" tab in the ZMI may have a value of: /devsiteFolder/images/ and be called, "imageDir". This variable is then used to call an image throughout the site using <img src="/<dtml-var imageDir>/imageName.gif"> When the site is moved to production, we change the string /devsiteFolder/images/ to /productionsiteFolder/images. Very simple, yet I cannot find good documentation on how to convert this to TAL if I wanted to use this inside a Page Template...Please Help
<img src="" tal:attributes="src string:${here/imageDir}/imageName.gif" />
I have read and re-read the current documentation and articles relating to "DTMLers learning TAL" and I must say the syntax is what has me most confused. A simple chart with sample TALES and its common functions would be a great help.
Have you read the Zope Book online, there are two chapters about ZPT and a reference appendix. -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's RADIOACTIVE MIDGET FROM XENO 69! (random hero from isometric.spaceninja.com)
Kevin Rosso wrote at 2003-11-26 08:50 -0800:
... For example, the variable string we create in the "properties" tab in the ZMI may have a value of: /devsiteFolder/images/ and be called, "imageDir". This variable is then used to call an image throughout the site using <img src="/<dtml-var imageDir>/imageName.gif">
This would become '<img tal:attributes="src string:${imageDir}/imageName.gif">'.
... I have read and re-read the current documentation and articles relating to "DTMLers learning TAL" and I must say the syntax is what has me most confused. A simple chart with sample TALES and its common functions would be a great help.
A think, there are HowTos and recipies (--> zopelab) for that. For me, careful reading of the TAL and TALES specs has been enough. The Zope Book has a section on PageTemplates. PageTemplates come with examples (--> "examples" subfolder of "Products/PageTemplates). If necessary, come with more specific questions. -- Dieter
participants (3)
-
Dieter Maurer -
Kevin Rosso -
Paul Winkler