Help! whrandom.choice
Hi, I want to randomly get the content of a file from a list of files in a directory. And the following code does that. However, the files have HTML code in them, and when they are displayed, the HTML tags are escaped. (i.e. the < is changed to > ) Is there a way to stop this from happeneing??? <dtml-if "diduknow.objectValues(['DTML Document'])"> <!--#var expr="_.whrandom.choice(diduknow.objectValues(['DTML Document']))"--> </dtml-if> Any help is apprtitated :) TIA Adonis
At 07:43 PM 12/21/99 -0500, technews@egsx.com wrote:
<dtml-if "diduknow.objectValues(['DTML Document'])"> <!--#var expr="_.whrandom.choice(diduknow.objectValues(['DTML Document']))"--> </dtml-if>
Try: <!--#var expr="_.whrandom.choice(diduknow.objectValues(['DTML Document']))(_.None,_)"--> The problem is that you're getting a DTML Document as the result of an expression. But then it's being converted to a string instead of being called to produce its output. Adding the (_.None,_) will call the DTML document and pass in the current namespace.
participants (2)
-
Phillip J. Eby -
technews@egsx.com