Last change
on this file since 14999 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 | """ |
---|
12 | return the breadcrumb trail |
---|
13 | """ |
---|
14 | try: |
---|
15 | from Products.zdb import set_trace |
---|
16 | except: |
---|
17 | def set_trace(): |
---|
18 | pass |
---|
19 | |
---|
20 | request = context.REQUEST |
---|
21 | |
---|
22 | if not 'academics' in request.get('PATH_INFO').split('/'): |
---|
23 | return [] |
---|
24 | |
---|
25 | trail = [] |
---|
26 | for 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, |
---|
34 | trail.reverse() |
---|
35 | return trail[:-1] |
---|
Note: See
TracBrowser for help on using the repository browser.