checking sequence-item variable?
Zopistas, how do I pull this off? <dtml-in "objectValues(['Folder'])"> <dtml-with sequence-item only> <dtml-unless noshow> do something </dtml-unless> </dtml-with> </dtml-in> I've tried messing around with the _ variable, with little luck. This is part of a menu, and the thing is, even if I don't want to show the folder in the menu, I don't want the menu to disappear when I'm in the folder. thanks, Ethan Fremen -- http://mindlace.net __________________ mindlace@imeme.net I don't want The Truth but I wouldn't mind a Big Analogy.
mindlace wrote:
how do I pull this off?
Well, I clicked send before I should have. This works: <dtml-with "PARENTS[-1].net" only>
<dtml-in "objectValues(['Folder'])"> <dtml-with sequence-item only> <dtml-unless noshow> do something </dtml-unless> </dtml-with> </dtml-in> </dtml-with>
but I don't understand why- I used to have <dtml-with net only> and that didn't work. ethan fremen -- http://mindlace.net __________________ mindlace@imeme.net I don't want The Truth but I wouldn't mind a Big Analogy.
mindlace wrote:
mindlace wrote:
how do I pull this off?
Well, I clicked send before I should have. This works:
<dtml-with "PARENTS[-1].net" only>
<dtml-in "objectValues(['Folder'])"> <dtml-with sequence-item only> <dtml-unless noshow> do something </dtml-unless> </dtml-with> </dtml-in> </dtml-with>
but I don't understand why- I used to have <dtml-with net only> and that didn't work.
The reason depends on how it didn't work. Did it give you an error and a traceback? -Michel
Michel Pelletier wrote:
mindlace wrote:
Well, I clicked send before I should have. This works:
<dtml-with "PARENTS[-1].net" only>
<dtml-in "objectValues(['Folder'])"> <dtml-unless noshow> do something </dtml-unless> </dtml-in> </dtml-with>
but I don't understand why- I used to have <dtml-with net only> and that didn't work.
I'm sorry, the corrected text above is what works. What never works is <dtml-with sequence-item only>. The error I get with <dtml-with sequence-item only> or <dtml-with _[sequence-item] only> are: KeyError: File /imeme/zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: menu) File /imeme/zope/lib/python/DocumentTemplate/DT_With.py, line 148, in render (Object: net) File /imeme/zope/lib/python/DocumentTemplate/DT_In.py, line 691, in renderwob (Object: objectValues(['Folder'])) File /imeme/zope/lib/python/DocumentTemplate/DT_With.py, line 148, in render (Object: sequence-item) File /imeme/zope/lib/python/DocumentTemplate/DT_Var.py, line 276, in render (Object: sequence-item) KeyError: sequence-item Do you see what I was trying to do? I wanted to see if just the sequence-item had the boolean attribute "noshow" Ethan Fremen -- http://mindlace.net __________________ mindlace@imeme.net I don't want The Truth but I wouldn't mind a Big Analogy.
Ethan, Try something like (tested, but not in this situation, i.e. I use it a lot and it works YMMV): <dtml-with "PARENTS[-1].net" only> <dtml-in "objectValues(['Folder'])"> <dtml-in aq_explicit only> <dtml-unless noshow> do something </dtml-unless> </dtml-in> </dtml-in> </dtml-with> HTH Phil phil.harris@zope.co.uk ----- Original Message ----- From: "mindlace" <mindlace@imeme.net> To: "Michel Pelletier" <michel@digicool.com> Cc: <zope@zope.org> Sent: 25 March 2000 23:10 Subject: Re: [Zope] checking sequence-item variable?
Michel Pelletier wrote:
mindlace wrote:
Well, I clicked send before I should have. This works:
<dtml-with "PARENTS[-1].net" only>
<dtml-in "objectValues(['Folder'])"> <dtml-unless noshow> do something </dtml-unless> </dtml-in> </dtml-with>
but I don't understand why- I used to have <dtml-with net only> and that didn't work.
I'm sorry, the corrected text above is what works. What never works is <dtml-with sequence-item only>. The error I get with <dtml-with sequence-item only> or <dtml-with _[sequence-item] only> are:
KeyError: File /imeme/zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: menu) File /imeme/zope/lib/python/DocumentTemplate/DT_With.py, line 148, in render (Object: net) File /imeme/zope/lib/python/DocumentTemplate/DT_In.py, line 691, in renderwob (Object: objectValues(['Folder'])) File /imeme/zope/lib/python/DocumentTemplate/DT_With.py, line 148, in render (Object: sequence-item) File /imeme/zope/lib/python/DocumentTemplate/DT_Var.py, line 276, in render (Object: sequence-item) KeyError: sequence-item
Do you see what I was trying to do? I wanted to see if just the sequence-item had the boolean attribute "noshow"
Ethan Fremen -- http://mindlace.net __________________ mindlace@imeme.net I don't want The Truth but I wouldn't mind a Big Analogy.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
<dtml-in "objectValues(['Folder'])"> <dtml-with sequence-item only> <dtml-unless noshow> do something </dtml-unless> </dtml-with> </dtml-in>
This is part of a menu, and the thing is, even if I don't want to show the folder in the menu, I don't want the menu to disappear when I'm in the folder.
Please clarify your request. I don not quiet understand what you want to do.... Cheers, Stephan -- Stephan Richter - (901) 573-3308 - srichter@cbu.edu CBU - Physics & Chemistry; Framework Web - Web Design & Development PGP Key: 735E C61E 5C64 F430 4F9C 798E DCA2 07E3 E42B 5391
participants (4)
-
Michel Pelletier -
mindlace -
Phil Harris -
Stephan Richter