I wanted to randomly pick a an image from an images folder and insert
it into my page. So I created a python script the return a random
selection from the images folder. 

Then, in my zpt I did

<span tal:define="global slot1 container/getimageR1" > 
  <!-- slot one item -->

Later in in the <img> tag I wanted to to do

<img tal:attributes="src slot1" >

however I found that slot1 was not giving me the full path to the
images folder. So I went back and did this:

<span tal:define="slot1 container/getimageR1" > 
  <!-- slot one item -->
  <span tal:define="global s1 python:'random1/'+slot1.getId()"></span>

in order to get the object to have the full url. 

It just seems there should be a better way. Anyone have a suggestion?

David Bear
phone:  602-496-0424
fax:    602-496-0955
College of Public Programs/ASU
University Center Rm 622
411 N Central
Phoenix, AZ 85007-0685
 "Beware the IP portfolio, everyone will be suspect of trespassing"
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to