Zopistas, I've got a download preview page for a pdf file. The pdf file is in the same directory and called pdf. In a method attached to the preview document, I want to find out the filesize of the associated pdf file. Something like this: <a href="<dtml-var absolute_url>.pdf">Download</a> XYZkb except XYZkb should be replaced with <dtml-var "pdffile.filesize()"> or something like that. But it has to generate the name for pdffile from the preview page id. So something like: <dtml-let "pdffile=id()+ 'pdf'"> <dtml-var "_[pdffile].filesize()"> This doesn't work, but I'm not sure what to do. I'm still totally confused about _. -- Ethan "mindlace" Fremen you cannot abdicate responsibility for your ideology.
Once again, merely submitting my question to the great pool of Zope Zen that is this list, I have become enlightened. <dtml-let name=id pdf=end pdffile="name + pdf" filesize="_[pdffile].get_size() / 1024"> <p class="download"><a href="<dtml-var absolute_url>.pdf">Download</a> <dtml-var filesize>kb</p> </dtml-let> now, somebody help me here- I get _ a little more. But is it a list, a tuple, or a dictionary? -- Ethan "mindlace" Fremen you cannot abdicate responsibility for your ideology.
participants (2)
-
Ethan Fremen -
Hannu Krosing