We tried some of the breadcrumb libraries too, but couldn't wrestle them into our paradigm, either. There are underlying assumptions about your app or url structure where it tries to divine patterns on its own that often just don't jibe with what you've got set up.<div>
<br></div><div>What we do instead is, we call a function to add another link in our breadcrumb chain, so it's deliberate and we're completely in control:</div><div><br></div><div>$c->add_breadcrumb( "/some/$url_component/here", 'Text for link here' );</div>
<div><br></div><div>throughout our code, and then in the template:</div><div><br></div><div><ul id="breadcrumbs"></div><div><div><li>You are here:</li></div><div>[% FOREACH crumb IN breadcrumbs -%]</div>
<div> <li>[%</div><div> IF loop.last %]<span title="You are here">[% crumb.label %]</span>[%</div><div> ELSE %]<a href="[% c.uri_for(crumb.path).path %]">[% crumb.label %]</a>[%</div>
<div> END</div><div> %]</li></div><div>[% END -%]</div></div><div></ul></div><div><br></div><div>And here's MyApp::add_breadcrumb en toto--</div><div><br></div><div><div>sub add_breadcrumb {</div>
<div> my ( $c, $path, $label ) = @_;</div><div> my $bc = $c->stash->{breadcrumbs} ||= [];</div><div> push @$bc, +{</div><div> path => $path,</div><div> label=> $label,</div><div> };</div>
<div>}</div><br><div class="gmail_quote">On Wed, Mar 23, 2011 at 8:40 AM, Kyle Hall <span dir="ltr"><<a href="mailto:kyle.m.hall@gmail.com">kyle.m.hall@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello All,<br>
<br>
I'm working on adding breadcrumbs to my catalyst app and I've run into<br>
something unexpected.<br>
<br>
I'm using Catalyst::Plugin::Breadcrumbs. Let's assume I have a<br>
controller Foo. If I just go to /foo ( the index ), the plugin assumes<br>
that the action will be 'index', but the action is actually just<br>
'foo'.<br>
<br>
Because of this, my breadcrumbs show as Foo/Foo instead of Foo/Index (<br>
or just Foo if hide_index is true ).<br>
<br>
Is this expected behaviour? Has the behaviour changed since<br>
Plugin::Breadcrumbs was written? I've been able to modify the code for<br>
the plugin to compensate, but was hoping someone could shed some light<br>
on this subject.<br>
<br>
Thanks,<br>
Kyle<br>
<br>
<a href="http://www.kylehall.info" target="_blank">http://www.kylehall.info</a><br>
Mill Run Technology Solutions ( <a href="http://millruntech.com" target="_blank">http://millruntech.com</a> )<br>
Crawford County Federated Library System ( <a href="http://www.ccfls.org" target="_blank">http://www.ccfls.org</a> )<br>
Meadville Public Library ( <a href="http://www.meadvillelibrary.org" target="_blank">http://www.meadvillelibrary.org</a> )<br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>11 cheers for binary!<br>
</div>