Samuli Natri
Dec. 30, 2015
Updated: Sep. 28, 2016
0
By Samuli NatriDec. 30, 2015
(Updated: Sep. 28, 2016)
0

Views #6 : Exposed Filters, Caching, Other Settings (Drupal 8 Tutorial #9) (Article + Video)

How to expose filters to visitors so they can change them and overview of the 'Other' settings, like caching.

Table of Contents

Exposed Filters

  • Edit the Content: Publishing status filter in the FILTER CRITERIA section and check the following:

  • Click Apply
  • Unpublish some items and you can see the filter in action:

Exposed Filters can also be blocks:

  • Go to Structure > Block layout and click Place block for the Sidebar first section:

Now the exposed filter is showing in the sidebar:

Check out Better Exposed Filters: http://www.wdtutorials.com/drupal/views/better-exposed-filters-drupal-tu... for extra options.

Other Settings


Here are some notes for the OTHER settings:

  • Sometimes it's useful to change the Machine Name to something more descriptive if you are planning to use the view display in some other place.
  • Enable Ajax to use options like pagers, sorting and exposed filters without page refresh.
  • Contextual link is the little pen picture you see when you hover over the view.
  • Aggregation can be used to group items together.
  • In the Query settings you could for example try to remove duplicates.

Especially when you have more complicated views with relationships, you might get duplicates. Check Views Distinct module in Drupal 7: "How To Remove Views Duplicates": http://www.wdtutorials.com/drupal/views/how-to-remove-views-duplicates-d...

For individual fields you can use STYLE SETTINGS to add CSS classes. Check this on how to use tokens to do it in Drupal 7: http://www.wdtutorials.com/drupal/views/how-to-use-tokens-to-style-views...

Samuli Natri is the founder of WDTutorials.com. He started building Drupal sites in 2010 with Drupal 6. He attended Helsinki University and Helsinki University of Technology (Social Sciences and Computer Science). Read more...

Add new comment