I am using the very helpful feature of having the exposed filters appear in a block. Exposed filter values are reliably being put into the URL and the page is reloaded, and the views content is updated to reflect the particular views values being filtered on.

Is there a general way to display the particular values being filtered on. For my particular application, I'm keen to display the filter values in the header area of the view.

e.g. If I've filtered on a particularly language for the nodes in this view, I'd like to include something like:

Language: English

in immutable text at the top of the view to reaffirm that the displayed list only includes English nodes.

Any pointers to snippets or features in this regard are most appreciated.

Comments

nally’s picture

Title: Option or Snippet to display exposed filter values in View Header » Display exposed filter values in view header or on page (snippet? attachment? configuration?)
remco75’s picture

Any progress on this one yet? i'm intrested to! seems a very nice feature

remco75’s picture

Found it: expose form in block = yes

dawehner’s picture

Status: Active » Fixed

Ah nice, so this is fixed

nally’s picture

Status: Fixed » Active

In fact, I don't think it's closed, unless I'm missing something very obvious.

The distinction here is that I'm looking for a way to display the ACTIVE filters. i.e.

"You've searched on Tags = drupalcon" kind of info. The filters are in the block (which I enabled as above) but I'd like the filters to show up on the page itself, or on the block with the filters.

esmerel’s picture

Category: support » feature
twistedindustries’s picture

I found this in over here, http://drupal.org/node/658566

<?php
$view = views_get_current_view();
print $view->exposed_input[date_filter][value][year];
?>

Can't get it to work for the life of me.

gotcha41’s picture

I have exact the same request. A text saying:
"The view is now being filtered on X, Y and Z"

gotcha41’s picture

After surfing the net, I found and edited a php code to extract variables from the url (as the active filter is as well a part of the url):
(my variable names are "Africa" and "Latin America")
the code has nothing to do with drupal, as it is pure php programming (=getting information from an url), but solves the problem here very well.

the code has two parts:
- first I set the text "Filter(s)" when there is a filter active
- then I let the right filter appear as text

if(isset($_GET["africa"]) || (isset($_GET["latin-america"]))) echo "Filter(s): ";

if($_GET["africa"] === "1") echo "Africa | ";
if($_GET["africa"] === "0") echo "Not Africa | ";
if($_GET["latin-america"] === "1") echo "Latin America | ";
if($_GET["latin-america"] === "0") echo "Not Latin America | ";

this code I put in the header of the view

Is there an option to automatically display all variable names (active filters) that have value 0 or 1 ? Without having to predefine the filter names in the code?

Or perhaps a solution that is based on the Drupal system, and not just php code?

iamjon’s picture

Status: Active » Closed (duplicate)