1

I'm setting up breadcrumbs in cakephp following the cookbook (cookbook). I'm doing this in my admin section (admin routing is on) and in my layout I have the line

echo $this->Html->getCrumbs(' > ','Home');

I change home to Admin Home and it displays fine, however the url links back to the website root i.e. website.com/ instead of website.com/admin. I've been looking around and can't find anything on this. I tried leaving out the second parameter in the method call which should then make it display the first breadcrumb in the array however it only shows the current breadcrumb for each page, not the whole trail.

Any help much appreciated.

4

2 回答 2

0

You can see that the getCrumbs is hardcoded to '/'. You'll have to override getCrumbs to linking to admin, or alternatively just add an

$this->Html->addCrumbs('Admin','/admin');

to your code

于 2011-05-11T09:52:25.440 回答
0

You could use this line of jQuery:

$('#breadcrumbs').children('a').first().attr('href','/admin')

If upgraded to CakePHP 2.1, there is now support for array as the second param.

于 2012-01-19T16:17:58.523 回答