chapter 5 Zope book - problems with the examples
Hi, I'm going through the examples in Chapter 5 of the Zope book and am having some problems. For those of you familiar with it, it is the 'Zope Zoo' example. Can anyone help me out? 1 - I create a DTML method called navigation as follows: <ul> <dtml-in expr="objectValues('Folder')"> <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a><br></li> </dtml-in> </ul> 2 - On viewing this method it works fine - a hyperlink to all sub-folders appears in the browser. 3 - I add '<dtml-var navigation>' into my standard_html_header so it reads: <html> <head> <title>ZAPHOD - zopetastic!</title> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> </head> <body bgcolor="#FFFFFF" LINK="#000099" VLINK="#555555"> <p><font face="Verdana, Arial, Helvetica, sans-serif" size="1"> If your name is Lee then click <a href="manage">here</a> to login.</font> <br> <dtml-var navigation> 4 - On viewing index.html (containing header & footer) everything except the navigation method appears. Viewing the source of index.html reveals that the <ul> tags are created... just no <li> elements. 5 - The HTML is fine... all tags closed & in te right place. Can anyone see a problem? Thanks in advance for any replies. My appologies also for such a long post. - Best regards, Lee Reilly
my guess is that your index.html is a dtmlDocument... Make it a dtmlMethod, and things will probably work.. Documents have their own namespace, so you are looking for folders inside index.html (and not finding any, of course).. if you need to have index.hmtl as a document, you could try (untested) <dtml-in expr="PARENTS[1].objectValues('Folder')"> good luck -- Geir Bækholt web-developer/designer geirh@funcom.com http://www.funcom.com on Thursday, November 16, 2000 Lee Reilly CS1997 wrote : LRC> Hi, LRC> I'm going through the examples in Chapter 5 of the Zope book and am LRC> having some problems. For those of you familiar with it, it is the 'Zope LRC> Zoo' example. LRC> Can anyone help me out? LRC> 1 - I create a DTML method called navigation as follows: LRC> <ul> LRC> <dtml-in expr="objectValues('Folder')"> LRC> <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a><br></li> LRC> </dtml-in> LRC> </ul> LRC> 2 - On viewing this method it works fine - a hyperlink to all LRC> sub-folders appears in the browser. LRC> 3 - I add '<dtml-var navigation>' into my standard_html_header so it LRC> reads: LRC> <html> LRC> <head> LRC> <title>ZAPHOD - zopetastic!</title> LRC> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> LRC> </head> LRC> <body bgcolor="#FFFFFF" LINK="#000099" VLINK="#555555"> LRC> <p><font face="Verdana, Arial, Helvetica, sans-serif" size="1"> LRC> If your name is Lee then click <a href="manage">here</a> to LRC> login.</font> LRC> <br> LRC> <dtml-var navigation> LRC> 4 - On viewing index.html (containing header & footer) everything except LRC> the navigation method appears. Viewing the source of index.html reveals LRC> that the <ul> tags are created... just no <li> elements. LRC> 5 - The HTML is fine... all tags closed & in te right place. LRC> Can anyone see a problem? LRC> Thanks in advance for any replies. My appologies also for such a long LRC> post. LRC> - Best regards, LRC> Lee Reilly LRC> _______________________________________________ LRC> Zope maillist - Zope@zope.org LRC> http://lists.zope.org/mailman/listinfo/zope LRC> ** No cross posts or HTML encoding! ** LRC> (Related lists - LRC> http://lists.zope.org/mailman/listinfo/zope-announce LRC> http://lists.zope.org/mailman/listinfo/zope-dev )
Make sure that all three objects (navigation, standard_html_header, and index_html) are DTML Methods and _not_ DTML Documents. If they are documents objectValues list the folders they contain (none) rather than the folders contained by the folder you call the method on. If any of these are Documents instead of Methods you need to replace "objectValues('Folder')" with something like "PARENTS[0].objectValues('Folder')". Chris On Thu, 16 Nov 2000, Lee Reilly CS1997 wrote:
Hi,
I'm going through the examples in Chapter 5 of the Zope book and am having some problems. For those of you familiar with it, it is the 'Zope Zoo' example.
Can anyone help me out?
1 - I create a DTML method called navigation as follows:
<ul> <dtml-in expr="objectValues('Folder')"> <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a><br></li> </dtml-in> </ul>
2 - On viewing this method it works fine - a hyperlink to all sub-folders appears in the browser.
3 - I add '<dtml-var navigation>' into my standard_html_header so it reads:
<html> <head> <title>ZAPHOD - zopetastic!</title> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> </head> <body bgcolor="#FFFFFF" LINK="#000099" VLINK="#555555"> <p><font face="Verdana, Arial, Helvetica, sans-serif" size="1"> If your name is Lee then click <a href="manage">here</a> to login.</font> <br> <dtml-var navigation>
4 - On viewing index.html (containing header & footer) everything except the navigation method appears. Viewing the source of index.html reveals that the <ul> tags are created... just no <li> elements.
5 - The HTML is fine... all tags closed & in te right place.
Can anyone see a problem?
Thanks in advance for any replies. My appologies also for such a long post.
- Best regards, Lee Reilly
_______________________________________________ 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 )
participants (3)
-
Chris Gray -
Geir B�kholt -
Lee Reilly CS1997