Whenever you are looking at a node which is a descendant of the home page, the 'Home' link appears twice.

Comments

niklp’s picture

I've tried some trickery here, but I don't think it can necessarily be achieved at the theme level. I tried checking the breadcrumb[1] element for the home string, and unsetting it if it existed, but it didn't work for some reason.

Other trickery involved checking the length of the bcrumb array, but if you again pop bcrumb[1], you lose a part of the hierarchy, if the parent node is not in the hierarchy (ie you're outside of the node spectrum; admin > build > blocks would look like admin > blocks).

Getting this fixed so a root page could be set up with no worries would be cool!

ronan’s picture

Status: Active » Fixed

Fixed. I'm removing the home node if it appears as the first item in the breadcrumb before adding it back again as 'Home'.

If your homepage is further down the hierarchy, I leave it alone, since if that's the case you obviously have some strange information architecture in mind and who am I to question your logic.

niklp’s picture

Does this essentially have no effect on theming of breadcrumbs? So one can still address/change the breadcrumbs as per before with theme_breadcrumb()?

Thanks.

ronan’s picture

I'm using drupal_set_breadcrumb() so there should be no change to how the breadcrumbs are themed.

Also, I'm not adding a breadcumb if you're on the home page no matter where in the hierarchy the homepage lies. This seemed like expected behavior.

niklp’s picture

Weird. Suspect there is a small, easily fixed bug here. If I adapt the theme_breadcrumb function to add the current node's title, the removal of the home node fails, using the following line in template.php:

$breadcrumb[] = drupal_get_title();

I think this is due to there being some residuals in the breadcrumb; when I print the contents of the breadcrumb with the above line enabled in the function, the output is thus: Array ( [0] => [1] => Front ) - this causes the output to be "> Front" when on the home page (root node called "front" obviously)

Otherwise this now seems to work.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

niklp’s picture

Status: Closed (fixed) » Active

Still an issue here, should have changed the status previously.

niklp’s picture

This has still not been fixed AFAIK. Just need to decipher where the empty array value is coming from and remove that element completely.

ronan’s picture

Status: Active » Fixed

Sorry for the log delay.

I've made a change to dev which I believe should remove the empty item in the breadcrumb array. Let me know if this fixes this issue for you.

Thanks
Ronan

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

niklp’s picture

Status: Closed (fixed) » Active

Not yet verified, reopening.

ronan’s picture

Status: Active » Fixed

I have posted some new code which may help fix your issue. Please check out the latest dev and see if it takes care of your issue.

Thanks
Ronan

niklp’s picture

Thanks Ronan - I'll do another complete review of the module when I have some time.

Cheers,
Nik

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.