I'm new to the TT and having a wee bit of bother getting bread crumbing
to work.
The idea is:
*) No crumbs on the home page
*) Sub-directories index page is bread crumbed to the directory above
*) Sub-directories non-index page is bread crumbed to the current
directory.
It seems that I can not access crumbs.n inside the WHILE loop. I can
access crumbs (prints an array ref), but not the array elements. Is this
an out of scope problem?
<div id="breadCrumb">
[%
# Bread-crumbs for all pages other than the home page:
IF template.name != 'index.tmpl';
crumbs = template.name.split('/');
IF crumbs.last == 'index.tmpl';
discarded = crumbs.pop;
END;
-%]
| <a href="/" title="Home">Home</a>
[%-
FOREACH crumb IN crumbs;
href = '/';
n = 0;
WHILE n < loop.index;
href = href.join(crumbs.n);
href = href.join('/');
label = crumbs.n;
n = n + 1;
END;
%]
> <a href="[% href %]" title="Up a level">[% label %]</a>
[%-
END;
END;
%]
</div>
--
Craig Skinner | http://www.kepax.co.uk | [EMAIL PROTECTED]
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates