|
|
The breadcrumb nav example in the TG docs has too many undocumented assumptions and requires the fastdata widget to work as written.
This is a rewrite and modification of the breadcrumb example in a way that is more generic, makes no assumptions about your code except that you are using TG and Kid templating. One import in your controllers.py and a small kid snippet and BAM!
breadcrumbs.py is a derivative of http://docs.turbogears.org/1.0/BreadCrumb with additional guidances from Marco Mariani via the TG list.
this module makes no assumptions about the types of controllers or other imports. Add it to your project, then import it in your controllers.py with::
import breadcrumbs
Next modify your template by adding the following template snippet (assumes kid templating)::
<div id='navbar'>
<span py:for='breadcrumbURL,breadcrumbName in tg.breadcrumbs()'>
<a class='menu' href='${breadcrumbURL}'>${breadcrumbName}</a>
</span>
</div>
This is a rewrite and modification of the breadcrumb example in a way that is more generic, makes no assumptions about your code except that you are using TG and Kid templating. One import in your controllers.py and a small kid snippet and BAM!
breadcrumbs.py is a derivative of http://docs.turbogears.org/1.0/BreadCrumb with additional guidances from Marco Mariani via the TG list.
this module makes no assumptions about the types of controllers or other imports. Add it to your project, then import it in your controllers.py with::
import breadcrumbs
Next modify your template by adding the following template snippet (assumes kid templating)::
<div id='navbar'>
<span py:for='breadcrumbURL,breadcrumbName in tg.breadcrumbs()'>
<a class='menu' href='${breadcrumbURL}'>${breadcrumbName}</a>
</span>
</div>
