I'd like to list the content of a folder, except if it is the standard_html_header or footer. I use this code: <dtml-unless "'id' == 'standard_html_header'"> <dtml-unless "'id' == 'standard_html_footer'"> <dtml-in expr="foldername.objectValues()"> <a href="<dtml-var absolute_url>"><dtml-var id></a><br> </dtml-in> </dtml-unless> </dtml-unless> It works except of the fact, that standard_html_header and footer are listed anyway. Can anybody point me into the right direction please? TIA -goe- _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Try putting the dtml-unless tags inside the loop. Currently, you are only testing the id of the document that is calling this method. If you put htem inside the loop, you will be testing the id of the current index of the iteration. --sam Stephan Goeldi wrote:
I'd like to list the content of a folder, except if it is the standard_html_header or footer. I use this code:
<dtml-unless "'id' == 'standard_html_header'"> <dtml-unless "'id' == 'standard_html_footer'"> <dtml-in expr="foldername.objectValues()"> <a href="<dtml-var absolute_url>"><dtml-var id></a><br> </dtml-in> </dtml-unless> </dtml-unless>
It works except of the fact, that standard_html_header and footer are listed anyway. Can anybody point me into the right direction please?
TIA -goe-
_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
_______________________________________________ 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 )
-- ----------------------------------------------- "The language and concepts contained herein are guaranteed not to cause eternal torment in the place where the guy with the horns and pointed stick conducts his business." --Frank Zappa
First off, dtml-unless probably won't do you much good here unless it's actually within the dtml-in. Think about this. Where does 'id' come from? Second, by doing 'id' == 'standard_html_whatever' you are comparing two strings. Of course 'id' will never equal anything other than 'id'. So, something like this should work (untested): <dtml-in expr="foldername.objectValues()"> <dtml-unless "id == 'standard_html_header'"> <dtml-unless "id == 'standard_html_footer'"> <a href="<dtml-var absolute_url>"><dtml-var id></a><br> </dtml-unless> </dtml-unless> </dtml-in>
I'd like to list the content of a folder, except if it is the standard_html_header or footer. I use this code:
<dtml-unless "'id' == 'standard_html_header'"> <dtml-unless "'id' == 'standard_html_footer'"> <dtml-in expr="foldername.objectValues()"> <a href="<dtml-var absolute_url>"><dtml-var id></a><br> </dtml-in> </dtml-unless> </dtml-unless>
"M. Adam Kendall" wrote:
First off, dtml-unless probably won't do you much good here unless it's actually within the dtml-in. Think about this. Where does 'id' come from?
Second, by doing 'id' == 'standard_html_whatever' you are comparing two strings. Of course 'id' will never equal anything other than 'id'. So, something like this should work (untested):
<dtml-in expr="foldername.objectValues()"> <dtml-unless "id == 'standard_html_header'"> <dtml-unless "id == 'standard_html_footer'"> <a href="<dtml-var absolute_url>"><dtml-var id></a><br> </dtml-unless> </dtml-unless> </dtml-in>
I'd like to list the content of a folder, except if it is the standard_html_header or footer. I use this code:
<dtml-unless "'id' == 'standard_html_header'"> <dtml-unless "'id' == 'standard_html_footer'"> <dtml-in expr="foldername.objectValues()"> <a href="<dtml-var absolute_url>"><dtml-var id></a><br> </dtml-in> </dtml-unless> </dtml-unless>
Furthermore, you will find accessing id in an expression to be troublesome. For some objects it is an attribute, for others it is a method. Use getId() in place of id. example: <dtml-in name="objectValues"> <dtml-unless expr="getId() in ['standard_html_header','standard_html_footer','standard_error_message']"> ...Some code... </dtml-unless> </dtml-in> hth -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
participants (4)
-
Casey Duncan -
M. Adam Kendall -
sam gendler -
Stephan Goeldi