1 ##parameters=include_root=1
2 ##title=Return breadcrumbs
4 from string
import join
7 portal_url
= context
.portal_url()
10 result
.append( { 'id' : 'root'
11 , 'title' : context
.portal_properties
.title()
16 relative
= context
.portal_url
.getRelativeContentPath( context
)
17 portal
= context
.portal_url
.getPortalObject()
18 checkPermission
= context
.portal_membership
.checkPermission
19 from Products
.CMFCore
.permissions
import View
21 for i
in range( len( relative
) ):
22 now
= relative
[ :i
+1 ]
23 obj
= portal
.restrictedTraverse( now
)
24 if not now
[ -1 ] == 'talkback':
25 result
.append( { 'id' : now
[ -1 ]
26 , 'title' : obj
.title_or_id()
27 , 'url' : checkPermission(View
, obj
) and (portal_url
+ '/' + join( now
, '/' )) or None