[Zope-CMF] Re-working breadcrumbs script

davelehman@loewen.com davelehman@loewen.com
Mon, 27 Aug 2001 13:12:24 -0500


I'm trying to extend the "breadcrumbs" script that Chris Withers posted to
this list back in June
(http://lists.zope.org/pipermail/zope-cmf/2001-June/007190.html)

I want to have the breadcrumbs string that is returned show the Title of a
folder (if it exists) instead of just the id from the URL. I'm not quite
sure how to do this...

----------
url = portal_url()
steps = split(path,'/')
breadcrumbs = []
last = steps.pop()

for step in steps:
    url = '%s/%s' % (url,url_quote(step))
    breadcrumbs.append(pattern % (url,step))
----------

In the "steps" loop, we're building the breadcrumb string. So we have the
url of the folder object I would like to grab the title from. I'm sure I
need to do something like this:

----------
for step in steps:
    url = '%s/%s' % (url,url_quote(step))
    title = url.Title()
    breadcrumbs.append(pattern % (url,title))
----------

but obviously that's not the right syntax. Sorry for being such an idiot
here-- can anyone give me a kick in the right direction?


--dave