<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Feb 6, 2007, at 5:26 AM, Gert Burger wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hi</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Can someone who has implemented "bread crumbs" using catalyst please share their methods/problems etc. I need to implement it but I stuck between different implementation techniques and would like to learn from other people's experience.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV></BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV>It still feels a little kludgy, but this is how I'm doing it currently...<DIV><BR class="khtml-block-placeholder"></DIV><DIV>package MyApp::View::TT;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>sub template_vars {</DIV><DIV>    my ( $self, $c ) = @_;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    my %vars = $self-&gt;SUPER::template_vars( $c );</DIV><DIV>    $vars{ 'site' }-&gt;{ 'breadcrumbs' } = $self-&gt;breadcrumbs( $c );</DIV><DIV>    return %vars;</DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>sub breadcrumbs {</DIV><DIV>    my ( $self, $c ) = @_;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    my @breadcrumbs = ();</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    my @paths = split( '/', $c-&gt;req-&gt;path );</DIV><DIV>    while ( my $label = pop( @paths ) ) {</DIV><DIV>        next if $label eq 'index';</DIV><DIV>        my $path = join( '/', @paths, $label );</DIV><DIV>        $path = "/$path" unless $path =~ m#^/#;</DIV><DIV>        $label = $self-&gt;label_for( $c, $path, $label );</DIV><DIV>        unshift( @breadcrumbs, {</DIV><DIV>            path =&gt; $path,</DIV><DIV>            label =&gt; $label,</DIV><DIV>            uri =&gt; $c-&gt;uri_for( $path ),</DIV><DIV>        } );</DIV><DIV>    }</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    unshift( @breadcrumbs, {</DIV><DIV>        path =&gt; '/',</DIV><DIV>        label =&gt; 'My Application',</DIV><DIV>        uri =&gt; $c-&gt;uri_for( '/' ),</DIV><DIV>    } );</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    return \@breadcrumbs;</DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>sub label_for {</DIV><DIV>    my ( $self, $c, $path, $label ) = @_;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    if ( my $x = $c-&gt;config-&gt;{ 'breadcrumbs' }-&gt;{ $path } ) {</DIV><DIV>        return $x;</DIV><DIV>    }</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    $label = join( ' ', map { ucfirst } split( /[_-]/, $label ) );</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    return $label;</DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>1;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>[% FOREACH item IN site.breadcrumbs %]</DIV><DIV>  [% IF loop.last %]</DIV><DIV>    [% title or template.title or item.label %]</DIV><DIV>  [% ELSE %]</DIV><DIV>    &lt;a href="[% item.uri %]"&gt;[% item.label %]&lt;/a&gt;  &amp;gt;&amp;gt;</DIV><DIV>  [% END %]</DIV><DIV>[% END %]</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Jason Kohles</DIV><DIV><A href="mailto:email@jasonkohles.com">email@jasonkohles.com</A></DIV><DIV><A href="http://www.jasonkohles.com">http://www.jasonkohles.com</A>/</DIV><DIV>"A witty saying proves nothing."  -- Voltaire</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></DIV></BODY></HTML>