Reputation: 4345
Plone has a nice hack that does away with the boring Zope Quickstart page that ships with Zope2. It changes this:
Into this:
Relevant code is located in Products/CMFPlone/browser/admin.zcml
(https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/browser/admin.zcml#L35):
<browser:page
for="OFS.interfaces.IApplication"
name="plone-overview"
class=".admin.Overview"
permission="zope.Public"
template="templates/plone-overview.pt"
/>
And that explains why http://localhost:8080/plone-overview
renders the plone-overview template, but why/how does the application root i.e. http://localhost:8080
render the same template?
Upvotes: 3
Views: 199
Reputation: 1121266
That same ZCML file registers a AppTraverser
adapter; this adapter adapts the OFS.interfaces.IApplication
object to IRequest
to intercept traversal.
In the IRequest
adapter publishTraverse()
method, when the index_html
name is traversed over, the adapter returns the same plone-overview
view:
def publishTraverse(self, request, name):
if name == 'index_html':
view = queryMultiAdapter((self.context, request),
Interface, 'plone-overview')
if view is not None:
return view
return DefaultPublishTraverse.publishTraverse(self, request, name)
See the AppTraverser
class definition.
Upvotes: 5