[Zope] Boolean dtml redux

Casey Duncan cduncan@kaivo.com
Tue, 03 Jul 2001 14:41:01 -0600


Leigh Ann Hildebrand wrote:
> 
> I'm sorry to post about this *again*, but I have still gotten no answer
> that works. I've spent a week now, changing the same 3 lines to various
> permutations, and none of the suggestions has worked. So, here again:
> 
> <dtml-in expr="_[foldername].objectValues()" sort="bobobase_modification_time"
> reverse>
> <dtml-unless "_['id']=='index_html'">
> <li>
> <a href="<dtml-var absolute_url>"><dtml-var title></a><br>
> Maintained by <dtml-var maintainer missing="No maintainer">. <br><dtml-var
> description missing="No description."> Last revision date <dtml-var version_date
> missing="unknown">.
> </dtml-unless>
> </dtml-in>
> 
> The problem: I need to change the line
> <dtml-unless "_['id']=='index_html'"> so that it's "unless the
> object boolean index_hide property is true for the particular object".
> 
> I've had several suggestions; whenever I use them, they either have no
> effect at all, or they work such that the file listing is completely
> blank if *any* file in the folder has the index_hide property set.
> 
> Suggestions? Please assume *no* programming. It doesn't help to make
> vague suggestions, as I have plenty of those and they don't seem to be
> helping. I'm looking for *exact* syntax of a line that would replace
> that one problem line.
> 
> Thanks!
> 
> Leigh Ann
> 
> --
> Leigh Ann Hildebrand
> leighann@onebox.com - email
> (650) 223-2199 x2231 - voicemail/fax
> 

<dtml-in expr="_.getitem(foldername).objectValues()"
sort="bobobase_modification_time" reverse>
 <dtml-unless name="index_hide">
   <li>
   <a href="<dtml-var absolute_url>"><dtml-var title></a><br>
   Maintained by <dtml-var maintainer missing="No maintainer">.
<br><dtml-var
   description missing="No description."> Last revision date <dtml-var
version_date
   missing="unknown">.
 </dtml-unless>
</dtml-in>

This will work assuming there is no property "index_hide" set on the
document or containing folders and there is no object in the namespace
or name in REQUEST called "index_hide". If there is, you could put
<dtml-let index_hide="0">...</dtml-let> around the whole thing.

hth,
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>