Boolean dtml redux
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 __________________________________________________ FREE voicemail, email, and fax...all in one place. Sign Up Now! http://www.onebox.com
<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>
ugh. this looks like a good place for a python script.
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.
if you insist, try this. <untested> <dtml-in expr="_[foldername].objectValues()" sort="bobobase_modification_time" reverse> <dtml-unless "_.getitem(_['sequence-item']).index_hide"> blah blah blah </dtml-unless> </dtml-in> </untested>
if you insist, try this.
<untested>
<dtml-in expr="_[foldername].objectValues()" sort="bobobase_modification_time" reverse> <dtml-unless "_.getitem(_['sequence-item']).index_hide"> blah blah blah </dtml-unless> </dtml-in>
</untested>
Upon reflection it might work if you make the <dtml-unless > look like this. <dtml-unless "_.getitem(id).index_hide">
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 `------------------>
On Tue, 3 Jul 2001, 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".
This sentence doesn't make any sense. index_hide is a boolean property of what? What is the particular object? I can't give you a solution because of that, but I can give you a tip, you don't need to say "['id']", you can just say "id". The ['x'] syntax is for when 'x' is not a valid name in a python expression. 'id' is valid. "The Nut-House" is not valid and so you would use the "['The Nut-House']" syntax. A valid python name is any combination of letters, numbers, or an underscore (no spaces or any other symbols). A name also can't start with a number, ie 5bob is illegal, but bob5 is fine. -Michel
participants (4)
-
Casey Duncan -
Leigh Ann Hildebrand -
Michel Pelletier -
Steve Drees