<dtml-with> works from one directory but not another depending upon the directory name
I have a case where including a file works based on the name of the folder. My directory looks like this: / /html/ /News/ When I do <dtml-with html> <dtml-var news_html> </dtml-with> I get output as I would expect. However, when I cut and paste this same file to the News directory and do <dtml-with News> <dtml-var news_html> </dtml-with> I get the following traceback: Traceback (innermost last): File /zope/Zope-2.1.1-linux2-x86/lib/python/ZPublisher/Publish.py, line 214, in publish_modul<!-- Traceback (innermost last): File /zope/Zope-2.1.1-linux2-x86/lib/python/ZPublisher/Publish.py, line 214, in publish_modul<!-- Traceback (innermost last): File /zope/Zope-2.1.1-linux2-x86/lib/python/ZPublisher/Publish.py, line 214, in publish_modul<!-- Traceback (innermost last): File /zope/Zope-2.1.1-linux2-x86/lib/python/ZPublisher/Publish.py, line 214, in publish_modul<!-- Traceback (innermost last): File /zope/Zope-2.1.1-linux2-x86/lib/python/ZPublisher/Publish.py, line 214, in publish_modul<!-- Traceback (innermost last): File /zope/Zope-2.1.1-linux2-x86/lib/python/ZPublisher/Publish.py, line 214, in publish_modul<!-- Traceback (innermost last): File /zope/Zope-2.1.1-linux2-x86/lib/python/ZPublisher/Publish.py, line 214, in publish_modul<!-- Traceback (innermost last): File /zope/Zope-2.1.1-linux2-x86/lib/python/ZPublisher/Publish.py, line 214, in publish_modul<!-- Traceback (innermost last): File /zope/Z Does anyone know why the same file should work with the html directory and not the directory named News? Is News somehow a reserved word? Thanks, John
I have some more info on this - it turns out that this was a namespace problem. When I explicitly passed the namespace PARENTS[-1].News it worked. I'm still not quite 100% sure I understand why this worked but it did. I used the following dtml: <dtml-with "PARENTS[-1].News"> <dtml-var expr="_.getitem('news_html',1)"> </dtml-with>
I have a case where including a file works based on the name of the folder.
My directory looks like this: / /html/ /News/
When I do <dtml-with html> <dtml-var news_html> </dtml-with>
I get output as I would expect.
However, when I cut and paste this same file to the News directory and do <dtml-with News> <dtml-var news_html> </dtml-with>
John
participants (1)
-
John Glossner