Translate View More/Less text in Facet Blocks in Drupal 7

Enable facet_bonus block. Then you will have hook_facet_items_alter. To enable the hook you need to go to configuration of facets and click on the facet configure filter and enable rewrite call back function.

Example Code


* Implements hook_facet_items_alter().
* Translate facetblock strings.
function module_name_facet_items_alter(&$build, &$settings) {
$facet_trans_set = array(
if (in_array($settings->name, $facet_trans_set)) {
$settings->settings['facet_more_text'] = t($settings->settings['facet_more_text']);
$settings->settings['facet_fewer_text'] = t($settings->settings['facet_fewer_text']);


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s