Back to index

plone3  3.1.7
Public Member Functions
CMFPlone.browser.navigation.CatalogNavigationBreadcrumbs Class Reference
Inheritance diagram for CMFPlone.browser.navigation.CatalogNavigationBreadcrumbs:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.browser.navigation.CatalogNavigationBreadcrumbs:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def breadcrumbs

Detailed Description

Definition at line 193 of file navigation.py.


Member Function Documentation

Definition at line 196 of file navigation.py.

00196 
00197     def breadcrumbs(self):
00198         context = aq_inner(self.context)
00199         request = self.request
00200         ct = getToolByName(context, 'portal_catalog')
00201         query = {}
00202 
00203         # Check to see if the current page is a folder default view, if so
00204         # get breadcrumbs from the parent folder
00205         if utils.isDefaultPage(context, request):
00206             currentPath = '/'.join(utils.parent(context).getPhysicalPath())
00207         else:
00208             currentPath = '/'.join(context.getPhysicalPath())
00209         query['path'] = {'query':currentPath, 'navtree':1, 'depth': 0}
00210 
00211         rawresult = ct(**query)
00212 
00213         # Sort items on path length
00214         dec_result = [(len(r.getPath()),r) for r in rawresult]
00215         dec_result.sort()
00216 
00217         rootPath = getNavigationRoot(context)
00218 
00219         # Build result dict
00220         result = []
00221         for r_tuple in dec_result:
00222             item = r_tuple[1]
00223 
00224             # Don't include it if it would be above the navigation root
00225             itemPath = item.getPath()
00226             if rootPath.startswith(itemPath):
00227                 continue
00228 
00229             id, item_url = get_view_url(item)
00230             data = {'Title': utils.pretty_title_or_id(context, item),
00231                     'absolute_url': item_url}
00232             result.append(data)
00233         return result
00234 

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: