Dear all, Stuck on something at the moment, which I hope you can shed some light on: I'm trying to use a dependency in order to decide whether to print a value; the dependency being on the 'page' having an ID of index_html Code snippet: <dtml-unless expr="id=='index_html'"> <dtml-var id> </dtml-unless> This does not work - I'm assuming this is because ID is an object, rather than a string, and therefore not comparable. I've tried converting the object to a string, but this goofs and prints nothing to the screen: <dtml-call "REQUEST.set('page_id', _.str(id))"> <dtml-var page_id> but this deposits something like: <Python Method object at 14c9990> within the source, before I get anywhere near trying to make comparisons... Anyone tell me what I am doing wrong? Thanks, Paul ------------------------------------------------------------------------------------------ Paul.Smith@bristol.ac.uk Internet Development Institute for Learning and Research Technology, http://www.ilrt.bris.ac.uk/ University of Bristol, 8-10 Berkeley Square, Bristol BS8 1HH, UK Tel: +44 (0)117 928 7083, Fax: +44 (0)117 928 7112
On Tue, 24 Jul 2001, Paul Smith wrote:
Code snippet:
<dtml-unless expr="id=='index_html'"> <dtml-var id> </dtml-unless>
This does not work - I'm assuming this is because ID is an object, rather than a string, and therefore not comparable. I've tried converting the object to a string, but this goofs and prints nothing to the screen:
<dtml-call "REQUEST.set('page_id', _.str(id))"> <dtml-var page_id>
but this deposits something like:
<Python Method object at 14c9990>
use getId() instead of id hoping this helps. Jerome Alet
--- Paul Smith <paul.smith@bristol.ac.uk> wrote: snip..
Code snippet:
<dtml-unless expr="id=='index_html'"> <dtml-var id> </dtml-unless>
snip.. Would this work? (it seems to work in a DTML-Document, D-Meth crapped out!) <dtml-unless expr="_['id']=='index_html'"> <dtml-var id> </dtml-unless> -Amr __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
participants (3)
-
Amr Malik -
Jerome Alet -
Paul Smith