Drupal facet change layout
Is there any way to change the layout of a facet?
I know you can create a file in the template dir named: block-apachesolr_search-[field].tpl.php
The problem I am having is that at this stage the html in the block variable has already been created.
Is there any way to change the html or just get t开发者_StackOverflow社区he elements of the facet?
Thanks!!
are you talking about faceted search module?
you could overwrite stuff by adding it in your template file or something simmilar, forinstance i had to add the "clear-block" to a div and did it this way:
function themename_faceted_search_ui_facet_wrapper($env, $facet, $context, $content) {
$classes = array(
'faceted-search-facet', // Note: Tooltips rely on this class.
'faceted-search-env-'. $env->name,
'faceted-search-facet--'. check_plain($facet->get_key() .'--'. $facet->get_id()), // Note: Tooltips rely on this class.
'faceted-search-facet-'. ($facet->is_active() && $context != 'related' ? 'active' : 'inactive'),
'faceted-search-'. $context,
);
return ''. $content .''."\n";
}
took a while to find the right function in the module file, but i dont know of any other way.
精彩评论