So, While configuring a new site, I came across the 'root' setting in the navigation controlpanel. I tried using this - creating a 'subsite' and setting the path to the object.
the behavior confused me so much, I think it might be a bug, but now I'm not quite so sure.
Here are the steps to reproduce what I'm seeing:
1: Create a plonesite, a folder, and a subfolder
2: Look at the contents of 'folder' ( localhost:8080/plone/folder/folder_contents )
I see 'subfolder' listed in the folder_contents - as you would expect.
3: Go to site-setup->Navigation
4: set 'Root' to '/folder'
The Navigation now has 'subfolder' and "home" links to localhost:8080/plone/folder/ - as expected.
5: go back to localhost:8080/plone/folder/folder_contents
Empty? Why? This is the bug.
6: ok, click the 'home' icon under content listing - now I see the content.
7: Add content under that, where did it go?
Set navigation root back to '/' and folder contents goes back to correct behavior.
8: notice that the content you created in step 7 is now at localhost:8080/plone/newcontent
This seems way too weird to me. What's going on here?
The reason I want to call this a bug is because I would expect a configuration setting under Navigation to ONLY AFFECT NAVIGATION. When that setting starts affecting things like folder listings and the location where factories are called, I think we have a cohesion bug.
I have worked around the issue by leaving the configuration registry 'plone.root' alone, and setting the INavigationRoot interface marker on the 'folder' - which seems to be the behavior I'm looking for.
I think the culprit is here, but I haven't yet pdb'd it to be certain.:
This file has been truncated.
# -*- coding: utf-8 -*-
from Acquisition import aq_base
from Acquisition import aq_inner
from Acquisition import aq_parent
from plone.app.layout.navigation.interfaces import INavigationRoot
from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName
from zope.component import getUtility
from zope.component.hooks import getSite
def getNavigationRoot(context, relativeRoot=None):
"""Get the path to the root of the navigation tree.
If a relativeRoot argument is provided, navigation root is computed from
portal path and this relativeRoot.
If no relativeRoot argument is provided, and there is a root value set in
portal_properties, navigation root path is computed from
portal path and this root value.