[Zope-CMF] Re: Re-working Breadcrumbs

Andrew Sawyers andrew@zope.com
Tue, 28 Aug 2001 11:01:14 -0400


We actually have a python script for this coming to a CMFDecor cvs checkout
near you.
I'll finally get my cvs up to date with some fixes/improvments and other
general stuff today.
You can look at the breadcrumbs.py script in CMFDecor/skins/zpt_generic for
a working example of what you're looking for.
Andrew

> -----Original Message-----
> From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On Behalf
> Of davelehman@loewen.com
> Sent: Tuesday, August 28, 2001 10:41 AM
> To: zope-cmf
> Cc: chrisw@nipltd.com
> Subject: Re: [Zope-CMF] Re: Re-working Breadcrumbs
>
>
>
> I can see both of your points (both for ZPT and against) but back to my
> original point, can anyone help me get this *almost-working* revised
> breadcrumbs solution off the ground? More to the point, can
> someone tell me
> what the correct syntax of the "getPortalRoot()" line suggested below?
>
> > object = context.portal_url.getPortalRoot() # not sure of the exact
> syntax
> > here
> > for step in steps:
> >   object = object[step]
> >   url = object.absolute_url()
> >   title = object.Title()
> >   breadcrumbs.append(pattern % (url,title)
>
> Regards,
> Dave
>
>
> On 08/27/2001 06:27:11 PM "Chris Withers"wrote:
>
> >And this is why I think ZPT can be just as abused as DTML :-(
> >
> >Keep your logic in PythonScripts rather than torturing your designers by
> >having to wade through pain like that.
> >
> >If ZPT doesn't support that, then it's broken...
> >
> >Not that this a sore point for me or anything ;-)
> >
> >Chris
> >
> >----- Original Message -----
> >From: "Thomas Olsen" <tol@tanghus.dk>
> >To: "Chris Withers" <chrisw@nipltd.com>; <davelehman@loewen.com>
> >Cc: "zope-cmf" <zope-cmf@zope.org>
> >Sent: Monday, August 27, 2001 9:06 PM
> >Subject: Re: [Zope-CMF] Re: Re-working Breadcrumbs
> >
> >
> >> I doubt that this is less expensive - and it doesn't even show
> the title
> -
> >> just a ZPT way of doing it :-)
> >>
> >> <span tal:define="
> >>         path python:here.portal_url.getRelativeUrl(here);
> >>         steps python:modules['string'].split(path, '/');
> >>         last python:steps.pop();
> >>         breadcrumbs python:[];
> >>         url here/portal_url">
> >>     <span tal:replace="here/Type">Object</span> at
> >>     <span tal:condition="path" tal:repeat="step steps"><a
> >>     href=""
> >>     tal:define="dummy python:breadcrumbs.append(step); vstep
> >> python:here.truncID(step, size=15)"
> >>     tal:attributes="href python:'/'+modules['string'].join(breadcrumbs,
> >'/')"
> >>     tal:content="string:/${vstep}">Step</a></span>
> >>     <span tal:replace="string:/${last}">/Last</span>
> >> </span>
> >>
> >>
> >> On Monday 27 August 2001 20:25, Chris Withers wrote:
> >> > (always CC the list in case someone else can help too)
> >> >
> >> > > I'm sorry to bother you, but thought you might have a minute for a
> >quick
> >> > > question about the "breadcrumbs" script you posted to the Zope-CMF
> >list:
> >> > >
> >> > > I'm trying to extend your script a bit so that the
> breadcrumb string
> >> > > returned shows the Title of a folder (object) instead of
> just the id
> >from
> >> > > the URL. I'm not quite sure how to do this...
> >> >
> >> > try this:
> >> >
> >> > object = context.portal_url.getPortalRoot() # not sure of the exact
> >syntax
> >> > here
> >> > for step in steps:
> >> >   object = object[step]
> >> >   url = object.absolute_url()
> >> >   title = object.Title()
> >> >   breadcrumbs.append(pattern % (url,title)
>
>
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://www.zope.org/Products/PTK/Tracker for bug reports and
> feature requests
>