I need to change some default behavior from the facet API.
I am searching for documentation about the hook from the Facet API module, but I have not found anything for now, except a very good tutorial about Apache Solr and Facet API.
I downloaded the Facet API bonus module because I thought it would help me.
There are some very good features like Rewrite facet items via callback function, but it seems it only works for the markup; I can't change the input.
function custom_facet_facet_items_alter(&$build, &$settings) {
dsm($build);
dsm($settings);
if ($settings->facet == "field_produit_dev_durable") {
foreach($build as $key => $item) {
$build[$key]["#markup"] = drupal_strtoupper($item["#markup"]);
}
}
}
I tried to use the Devel modutle o see the content of the variables build, and setting, but there is nothing interesting for me.
So I need two things
- Understand how to change the checkbox input
- Understand how to remove the count number aside the Yes or No
I made my module and use this, but weirdly it doesn't remove the number.
$build[$key]["#markup"] = drupal_strtoupper($item["#markup"]);
I used the fist tutorial I linked at the beginning of my post, but I found a problem I don't understand.
When I used my code on two different facets I got an error:
An illegal choice has been detected. Please contact the site administrator.
My code is the same code shown in this article, but I replace the select field with a radio field. I think there is a conflict between the two form, when I validate.