[Zope] breadcrumbs ques

AM list_subscriber@neurobs.com
Wed, 18 Sep 2002 09:16:27 -0700


I get an attribute error for getPhysicalRoot()...

Traceback (innermost last):
  File /var/local/zope/leonardo/lib/python/ZPublisher/Publish.py, line 150, in publish_module
  File /var/local/zope/leonardo/lib/python/ZPublisher/Publish.py, line 114, in publish
  File /var/local/zope/leonardo/lib/python/Zope/__init__.py, line 159, in zpublisher_exception_hook
    (Object: layout)
  File /var/local/zope/leonardo/lib/python/ZPublisher/Publish.py, line 98, in publish
  File /var/local/zope/leonardo/lib/python/ZPublisher/mapply.py, line 88, in mapply
    (Object: gen_nav_list)
  File /var/local/zope/leonardo/lib/python/ZPublisher/Publish.py, line 39, in call_object
    (Object: gen_nav_list)
  File /var/local/zope/leonardo/lib/python/Shared/DC/Scripts/Bindings.py, line 252, in __call__
    (Object: gen_nav_list)
  File /var/local/zope/leonardo/lib/python/Shared/DC/Scripts/Bindings.py, line 283, in _bindAndExec
    (Object: gen_nav_list)
  File /var/local/zope/leonardo/lib/python/Products/PythonScripts/PythonScript.py, line 302, in _exec
    (Object: gen_nav_list)
    (Info: ({'script': <PythonScript instance at 8adb590>, 'context': <Folder instance at 8b69490>, 'container': <Folder instance at 8b69490>, 'traverse_subpath': []}, (), {}, None))
  File Script (Python), line 2, in nav_path
  File /var/local/zope/leonardo/lib/python/AccessControl/ZopeGuards.py, line 58, in guarded_getattr
    (Object: layout)
AttributeError: (see above)

Is the functionality not there in Py2.1

My config Zope 2.5.x on RH7.2 with Python 2.1.2

TIA
AM

Chris Withers wrote:

> AM wrote:
>
>>
>> <dtml-in PARENTS reverse>
>> <dtml-with PARENTS>
>>  <dtml-if sequence-start>
>>   <a href="/nbs_online" class='cyan_link'>Home</a>
>>  <dtml-else>
>>   <dtml-if sequence-end><dtml-else>&rsaquo;&rsaquo;
>>    <a href="<dtml-var absolute_url>" class='cyan_link'><dtml-var 
>> title_or_id></a>
>>   </dtml-if>
>>  </dtml-if>
>> </dtml-with>
>> </dtml-in>
>
>
> Using PARENTS for breadrumbs is bogus.
>
> I would do have a python script called 'breadcrumbs':
>
> result = []
> url = context.getPhysicalRoot().absolute_url()
> path = context.getPhysicalPath()
> for id in path:
>   url = url + '/' + id
>   result.append({'id':id,'url':url}
> return result[1:] # adjust as appropriate to get your site root
>
> Then just do the following in your method:
>
> <dtml-in breadcrumbs mapping>
> <a href="&dtml-url;">&dtml-id;</a>
> <dtml-unless sequence-end>
> &rsaquo;&rsaquo;
> </dtml-unless>
> </dtml-in>
>
> cheers,
>
> Chris
>
>
>

-- 
==================================================================
 Aseem Mohanty							   
 Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706 
 (R) 510 7696011 (M) 510 3014871 (O) 510 5279231		  	
==================================================================								  	
 "I saw `cout' being shifted "Hello world" times to the left and  
  stopped right there!!"                        -- Steve Gonedes  
==================================================================