1

I'm using FacetAPI-SearchAPI and I notice that, on every view based on search api in the breadcrumb there is the "all items" link and, when I add a facet to the search, the facet value is added to the breadcrumb.

Is there a way to remove "all items" and other facets elements from the breadcrumb?

2 Answers 2

4

In /sites/all/modules/facetapi/plugins/facetapi/url_processor_standard.inc there's a function setBreadcrumb() (around line 61).

Simply comment it out or put a return; on line 62.

A better way is to create your URL Processor which implements FacetapiUrlProcessor::setBreadcrumb()

2

This is something I used to reset the breadcrumb

/**
 * Implements hook_facetapi_searcher_info()
 */
function yourmodule_facetapi_searcher_info_alter(array &$searcher_info) {
  foreach ($searcher_info as $key => $value) {
    if($value['url processor'] == 'standard'){
      $searcher_info[$key]['url processor'] = 'yourprocessor';
    }
  }
}


function yourmodule_facetapi_url_processors() {
  return array(
    'yourprocessor' => array(
      'handler' => array(
        'label' => t('Your module URL processor'),
        'class' => 'FacetApiYourClass',
      ),
    ),
  );
}

class FacetApiYourClass extends FacetapiUrlProcessorStandard {
  public function setBreadcrumb() {
    // Keep default behavior.
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.