I'm Working in Plone 4.1 and I'm just curious to know the difference between Products.CMFPlone.interfaces.IPloneSiteRoot and Products.CMFCore.interfaces.ISiteRoot. If I want to register a zope-3 style view, to which one should I register it?
2 Answers
Whenever I want to use a site root, I usually end up using the INavigationRoot from plone.app.layout.navigation.interfaces.INavigationRoot instead.
The INavigationRoot is provided by the Plone site object, but it will also be provided by the navigation root of any subsite or the top level folders in a multi-lingual site. Especially in multi lingual sites, users will never navigate or see the actual site root itself, so any functionality attached to it won't be available to them.
The ISiteRoot only makes sense for things like export import handlers or other internal logic, but not for any enduser visible functionality.
-
So, do most users never see the actual site root? I mean, there's always a special view or an element that gets displayed instead of the actual site root, isn't it? – Noe Nieto Jun 01 '11 at 17:09
-
2In a default Plone users will see a good numbers of views on the site root, like the contact form, the sitemap, all control panels - but all of these are also registered for the navigation root so they still work in the subsite / multilingual cases. – Jun 01 '11 at 18:03
An IPloneSiteRoot is a specific kind of ISiteRoot. IPloneSiteRoot is provided by the root of a Plone site, whereas ISiteRoot is provided by any CMF portal. If your product is only intended to work in Plone, then it doesn't really matter which interface you use. If you want it to be usable with other CMF-based applications, then use ISiteRoot.
Frankly, I usually go with ISiteRoot just because it's shorter to type. :)

- 5,422
- 17
- 23