--- ECHO_content/ECHO_Nav.py 2012/01/18 16:57:00 1.84.2.1 +++ ECHO_content/ECHO_Nav.py 2012/01/19 19:03:28 1.84.2.2 @@ -29,6 +29,7 @@ from Products.PageTemplates.ZopePageTemp import os.path import urllib +import ECHO_helpers from ECHO_helpers import displayTypes,checkOnlyOneInGroup,unicodify from ECHO_collection import content_html import logging @@ -381,7 +382,14 @@ class ECHO_pageTemplate(ZopePageTemplate else: return 0 + def getCrumb(self): + """returns breadcrumb for this object""" + return ECHO_helpers.getCrumb(self) + def getHierCrumbs(self): + """returns a list of hierarchical breadcrumbs from self to the ECHO_root""" + return ECHO_helpers.getHierCrumbs(self); + ## def __init__(self, id, text=None, contentType=None): @@ -799,15 +807,24 @@ class ECHO_navigation(Folder): return style + 'sel' else: return style + + + def getCrumb(self): + """returns breadcrumb for this object""" + # ignore this object if title is empty + if not self.title: + return None - def getHierCrumbs(self): - """returns a list of hierarchical breadcrumbs from self to the ECHO_root""" - # crumb for this object + # we use title for the label TODO: add label to ECHO_root crumb = {'obj': self, 'url': self.absolute_url(), - 'label': self.get('label','Home')} - crumbs = [crumb] - return crumbs + 'label': self.title} + return crumb + + def getHierCrumbs(self): + """returns a list of hierarchical breadcrumbs from self to the ECHO_root""" + return ECHO_helpers.getHierCrumbs(self) + def buttonsFromHash(self,hash,start=None,orientation="horizontal"):