By Patrick Kenny


2015-05-23 15:23:54 8 Comments

Views has a great feature where you can expose the exposed filters as a block (Exposed form in block under Exposed form).

So what's the "standard" way to theme these? Is there a Views template for this (I couldn't find one), or do I theme it with a renamed block.tpl.php?

1 comments

@Patrick Kenny 2015-05-23 15:33:05

Actually, although the exposed filter block does not have any template file in the list under Theming information, you can theme it with a views template file like this:

views-exposed-form--MYVIEWNAME.tpl.php

There is an example views-exposed-form.tpl.php in the Views module theme directory.

@Jens Wegar 2018-03-19 13:24:18

The same seems to be true for Drupal 8 (does not suggest theme hook), but instead of tpl.php you create a new twig template in the templates folder of your theme: views-exposed-form--MY-VIEW-NAME.html.twig

@Salvador P. 2019-04-25 13:26:34

Just to say thanks and confirm that the way pointed by @JensWegar is working on D8.6.

Related Questions

Sponsored Content

2 Answered Questions

[SOLVED] How to theme one specific Views 3 exposed filter form template and HTML?

  • 2016-05-16 10:07:58
  • user56reinstatemonica8
  • 635 View
  • 0 Score
  • 2 Answer
  • Tags:   7 views

1 Answered Questions

[SOLVED] Views Template for first Block being applied to all

  • 2018-04-11 18:58:31
  • Travis Johnston
  • 10 View
  • 0 Score
  • 1 Answer
  • Tags:   7 views theming

9 Answered Questions

[SOLVED] Create template file for views block

2 Answered Questions

[SOLVED] How to use AJAX for an exposed filter form of a Views block?

  • 2016-07-04 17:33:04
  • user5482
  • 2703 View
  • 5 Score
  • 2 Answer
  • Tags:   blocks ajax views

2 Answered Questions

[SOLVED] How do I have views exposed filter results in separate block?

  • 2014-04-12 20:42:13
  • penone
  • 4817 View
  • 0 Score
  • 2 Answer
  • Tags:   views

1 Answered Questions

[SOLVED] Exposed form in block not found in block view drupal 7

  • 2015-04-06 14:30:48
  • Revolution
  • 498 View
  • 1 Score
  • 1 Answer
  • Tags:   views blocks

1 Answered Questions

[SOLVED] Multiple copies of Views filter form (exposed filters)

  • 2011-05-18 15:33:46
  • Laxman13
  • 2089 View
  • 4 Score
  • 1 Answer
  • Tags:   6 blocks views

2 Answered Questions

[SOLVED] Views exposed filter block shows twice

  • 2011-06-09 19:27:53
  • doublejosh
  • 841 View
  • 3 Score
  • 2 Answer
  • Tags:   blocks views

Sponsored Content