Remove or modify an Apache Solr facet link in a block
Last updated on
30 April 2025
In your template.php, we will add the following code. It is a theme override of theme_apachesolr_facet_link()
In the following example, we check for a facet called "Tip" and exit out early before it is themed. You can add your own code here and modify the arguments as necessary.
// Theme override of apachesolr_facet_link
function [your_theme_here]_apachesolr_facet_link($facet_text, $path, $options = array(), $count, $active = FALSE, $num_found = NULL) {
// Don't theme any facet text called 'Tip'
if ($facet_text == 'Tip') return;
$options['attributes']['class'][] = 'apachesolr-facet';
if ($active) {
$options['attributes']['class'][] = 'active';
}
$options['attributes']['class'] = implode(' ', $options['attributes']['class']);
return apachesolr_l($facet_text ." ($count)", $path, $options);
}
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion