Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a taxonomy terms with image field.
How can I expose terms of this taxonomy field as a filter with Term and image ?
Comments
Comment #2
mikeker CreditAttribution: mikeker as a volunteer commentedThis is outside the scope of BEF and should be handled in a custom theme. Sorry.
You can add the image variables in a preprocess and override the BEF template file so display them. (Eg: see
template_preprocess_bef_checkboxes
andbef-checkboxes.html.twig
).Comment #3
makbuk CreditAttribution: makbuk commentedDid you find a solution? I try to realise the same functionality.
Comment #4
makbuk CreditAttribution: makbuk commentedI was prompted how to do it. Thanks a lot to xandeadx. http://dru.io/question/8048
In my version TAXONOMY_ELEMENT = tid_1
Comment #5
SEVENTH7 CreditAttribution: SEVENTH7 as a volunteer commentedHow can i find the right TAXONOMY_ELEMENT ? tid_1 is not working for me?
Please help :)
Comment #6
ajFernandez CreditAttribution: ajFernandez commentedI think TAXONOMY_ELEMENT is the filter identifier in the view.
Comment #7
Dubs CreditAttribution: Dubs commentedHey - I know this is an old issue, but I had to do the same thing. Easiest way for me was to create a new better_exposed_filter plugin, and extend the existing one, e.g.
Then you can extend / change the exposedFormAlter function to suit, e.g.
In my case I created a custom theme function too further down so we could target the rendering with a new twig file, but you don't need to do that unless required.
You can just change the $form[$field_id]['#theme'] variable if you need to do that, and of course implement the custom theme hook in hook_theme in your module.
I hope that helps :-)