Tags/topics: 
8
Answers
Vote up!
2
Vote down!

Enable breadcrumbs on collection page

Greetings,

I'm using the Commerce Kickstarter V2 and while the breadcrumbs seem to work fine on basic pages, there has to be a way to enable them on the collection/all products page too, surely. When enabling breadcrumbs on the blocks menu, TWO copies of the breadcrumb appear in the content area, but I cant seem to find a way to just turn one on. Can anyone help me?

Asked by: Frankenstein123
on January 27, 2014

8 Answers

Vote up!
0
Vote down!

Hi, We also have this issue. Hoping to get support. thanks

Answer by: Mastap
Posted: Jan 28, 2014
Vote up!
0
Vote down!

So im not the only one facing this issue. Yeah, it's odd, breadcrums seem to only work on Collection pages if the "breadcrumb" block has been enabled, but in that case it creates TWO breadcrumbs on top of eachother. Still hoping someone has an answer.

Answer by: Frankenstein123
Posted: Jan 29, 2014
Vote up!
0
Vote down!

The quickest, laziest & easiest way is to just hide the set you don't want with some CSS ;-)

If you'd like to do it 'properly' then what theme are you using?

Andy @ BlueFusion
Posted: Jan 29, 2014
Vote up!
0
Vote down!

I'm all for laziness myself. Any idea how one would go about doing that in css? Sorry about this, I'm fairly new at this and just figuring things out myself, but for some reason this has become one of the biggest questions/stumbling blocks so far. I'm using the Commerce Kickstart Theme for now.

Answer by: Frankenstein123
Posted: Jan 30, 2014
Vote up!
0
Vote down!

We already had the breadcrumb block enabled, but we ended up having NO breadcrumb generated. You can view this problem in the regular install of Kickstart. There is no breadcrumb on the collection page there as well. And enabling the block does not show any either.

This is the hard way solution we ended up doing:

####################################
function hook_views_pre_render(&$view) {
//dpm('dd');
if ('collection_products' == $view->name && 'page' == $view->current_display) {
$breadcrumb = array();
$breadcrumb[] = l(t('Home'), NULL);
drupal_set_breadcrumb($breadcrumb);
}
}
####################################

Pfff. This is weird as we only initialize the variable. Boom, we have a bread crumb. I believe this should be turned into an issue...

Answer by: Mastap
Posted: Jan 30, 2014
Vote up!
0
Vote down!

Ah yes, I noticed the same on the kickstart demo page. The odd thing is, they seem to be there when looking at older screenshots of a kickstart install, so it seems this has come about just recently.

As for the code, I appreciate the help, I'm having a hard time figuring out how exactly to get that code working. I tried creating a custom module and an info file to go along with it to insert the hook, but that didnt seem to work, is there some other way I should go about doing this? Thank you for all the help so far.

Answer by: Frankenstein123
Posted: Jan 31, 2014
Vote up!
0
Vote down!

I had this problem too. MastaP's solution nearly worked for me, but I found that I had to change the breadcrumb later in the page cycle, because it was being clobbered later on. This worked for me:

<?php

//Implements hook_page_build
function fix_crumbs_page_build(&$page) {
  if(arg(0) == 'product_category'){
    $breadcrumb = array();
    $breadcrumb[] = l(t('Home'), NULL);
    drupal_set_breadcrumb($breadcrumb);
  }
}

Frankenstein123 - note that you'll need to change the word "hook" in the function name to the name of your module. (I've called my module fix_crumbs, above.)

Answer by: john
Posted: May 16, 2014
Vote up!
0
Vote down!

I'm still having this problem, none of the two proposed fixes worked for me.
Any help?

Answer by: Dries Delanote
Posted: May 28, 2014