Back to index

plone3  3.1.7
referencebrowser_filterBreadCrumbs.py
Go to the documentation of this file.
00001 ##parameters=crumbs, startup_directory
00002 
00003 # Filter out all breadcrumbs that match folders above
00004 # the current object as represented by the startup_directory
00005 
00006 server_url = context.REQUEST.SERVER_URL
00007 
00008 if startup_directory.startswith('/'):
00009     startup_directory = startup_directory[1:]
00010 
00011 portal = context.portal_url.getPortalObject()
00012 startup_folder = portal.restrictedTraverse(startup_directory)
00013 startup_folder_url = startup_folder.absolute_url()
00014 
00015 return [c 
00016         for c in crumbs 
00017         if c['absolute_url'].startswith(startup_folder_url)
00018        ]
00019