display object without index_html
i am developing a Zope product (2.7) with a "homepage" content type and want this object to display as the index of a folder. for other custom objects, i have display methods that call an index view ( using DTMLFile) of the object like this: #homepage view index_html = DTMLFile('dtml/indexHomepage', globals()) i want this object to display as the index of the folder without: folder/index_html/index_html however, when i render the object, i get: <Homepage at index_html> remove display: http://localhost:8080/www/index_html/index_html has an empty or missing docstring. Objects must have a docstring to be published. how can i ensure that an "homepage" object with an id of index_html will display as the index of a folder (without calling folder/index_html/index_html)? i hope i explained this coherently... any insight would be greatly appreciated- Thanks, Chris
Christopher Rivard wrote at 2005-5-18 11:51 -0600:
i am developing a Zope product (2.7) with a "homepage" content type and want this object to display as the index of a folder. for other custom objects, i have display methods that call an index view ( using DTMLFile) of the object like this:
#homepage view index_html = DTMLFile('dtml/indexHomepage', globals())
i want this object to display as the index of the folder without:
The rules for 'GET' requests are as follows: Perform url traversal to locate the object. If this object's "index_html" (maybe acquired) is 'None', then call the object; otherwise, use "index_html". Thus, you archive what you want by: index_html = None __call__ = DTMLFile(...) -- Dieter
Dieter Maurer wrote:
The rules for 'GET' requests are as follows:
Perform url traversal to locate the object. If this object's "index_html" (maybe acquired) is 'None', then call the object; otherwise, use "index_html".
Thus, you archive what you want by:
index_html = None __call__ = DTMLFile(...)
There's also that hook to specify the name of the method to look for instead of index_html. As I understand it, this code is in Zope, and has been for ages, even for normal folders, it's just that no one got around to implementing a ZMI UI for it :-S cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (3)
-
Chris Withers -
Christopher Rivard -
Dieter Maurer