specifying a different default view than index_html
Is there a way to specify a different default for when a folder is viewed so that it doesn't use index_html? Here's the situation: I have a hierarchy of folders. I want everything except the root to share a common index_html. The root is special -- the entry to my site. I don't want people to have to type anything other than the path to the root folder to enter the site (though if there's no other way to do it, it won't be a big deal if they have to add a specific .html file to the path). When they enter the site, they should get a different view than the default index_html. So, I need a way to either change the default used by the root or the default used by everything else. I realize I can interpose another level of folder between the root and everything else, in order to store defaults I don't want shared by the root. I may do that if there are more defaults I don't want shared with the root, but right now index_html is the only one. I'd be interested in design suggestions regarding this issue as well as hints for mechanisms to use.
This may seem like overkill. Then again, it may seem overly simplistic. Here goes... You can put a (big) <dtml-if> statement in your index_html. In the if statement, you can check to see if you user was looking for the "root" index_html. If so, render the unique text (i.e., the first portion of the if statement). Otherwise, render the "else" portion of the if statement. I believe that you can determine what the specific URL is in the REQUEST parameter. You should be able to do an equivalency check on the root folder. Hope that helps. Ron Mitchell L Model wrote:
Is there a way to specify a different default for when a folder is viewed so that it doesn't use index_html?
Here's the situation: I have a hierarchy of folders. I want everything except the root to share a common index_html. The root is special -- the entry to my site. I don't want people to have to type anything other than the path to the root folder to enter the site (though if there's no other way to do it, it won't be a big deal if they have to add a specific .html file to the path). When they enter the site, they should get a different view than the default index_html. So, I need a way to either change the default used by the root or the default used by everything else.
I realize I can interpose another level of folder between the root and everything else, in order to store defaults I don't want shared by the root. I may do that if there are more defaults I don't want shared with the root, but right now index_html is the only one.
I'd be interested in design suggestions regarding this issue as well as hints for mechanisms to use.
_______________________________________________ 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 )
Here's the situation: I have a hierarchy of folders. I want everything except the root to share a common index_html.
Mitchell, Having to figure this out for myself recently...I would go with your initial solution. You can still place ALL your methods (except index_html) in root, so the whole site including root can acquire them globally. You can kill your entry-page isolation in the future without having to undo a patched default method or mess with dtml-if's. example: root folder www.foo.com -index_html -all other global DTMLMethods -site (or main) folder www.foo.com/main - |-index_html -folder1 -folder2 -folder3... -Trevor
participants (3)
-
Mitchell L Model -
Ronald L. Chichester -
Trevor Toenjes