source: WAeUP_SRP/trunk/skins/waeup_academics/getBreadCrumbs.py @ 11107

Last change on this file since 11107 was 3496, checked in by Henrik Bettermann, 17 years ago

resolve #542

  • Property svn:keywords set to Id
File size: 761 bytes
Line 
1## Script (Python) "getBreadCrumbs"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=student=None
8##title=
9##
10# $Id:getDocumentInfo.py 486 2006-09-06 10:09:39Z joachim $
11"""
12return the breadcrumb trail
13"""
14try:
15    from Products.zdb import set_trace
16except:
17    def set_trace():
18        pass
19
20request = context.REQUEST
21
22if not 'academics' in request.get('PATH_INFO').split('/'):
23    return []
24
25trail = []
26for crumb in request.PARENTS:
27    if crumb.id == "campus":
28        break
29    d = {}
30    content = crumb.getContent()
31    d['title'] = getattr(content,'LongTitle',None) or content.Title
32    d['url'] = crumb.absolute_url()
33    trail += d,
34trail.reverse()
35return trail[:-1]
Note: See TracBrowser for help on using the repository browser.