[Zope-CMF] Annotated Dogbowl Skins and ZPT

Paul Everitt paul@zope.com
Wed, 26 Sep 2001 09:39:53 -0400


Here's an implementation of what Tres suggested (courtesy of Evan). 
First, here's a Python Script called breadcrumbs:

breadcrumbs
-----------------------------------------------------
from string import split, count
path = context.absolute_url(relative=1)

if not path: return

url = context.portal_url(relative=1)
bases = count(url, '/')
steps = split(path, '/')[bases:-1]

crumbs = []

while steps:
     step = steps.pop(0)
     url = '%s/%s' % (url, step)
     crumbs.append({'url': url, 'title': step})

return crumbs
-----------------------------------------------------

and here is the section in the main_template that formats it:

           <div id="Breadcrumbs">
             <a tal:attributes="href here/portal_url">Home</a>

             <span tal:repeat="step here/breadcrumbs">&gt;
             <a tal:attributes="href step/url"
                tal:content="step/title"
                tal:omit-tag="not:step/url">
             step</a>
             </span>
           </div>

Man, that's fun!

--Paul

Norman Khine wrote:

> How do you implement the Bredcrumbs link using the new ZPT_skins, as is
> currently on the http://cmf.zope.org site.
> 
> I have followed the http://cmf.zope.org/doc/admin/dogbowl_skins/view and
> looking at the zpt_generic folder I see we have the python script
> breadcrumbs, but am at a loss as to how to include it and the changes that I
> need to make.
> 
> Thanks for all you advice.
> 
> Norman
> 
> 
> 
> 
> _______________________________________________
> 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
>