With Views are built all the lists of content in the default Drupal 8 installation. The front page list, the admin content overview page, all the taxonomy term, user lists etc.
Knowing how to use Views means not only that you can add bells and whistles to those pages, to make them look as you wish but also that you can create complete new pages, blocks with content, featured articles lists and much more.
In Drupal 8 the Views module is already in core. That means that it is no longer just the coolest contributed Drupal module, but is part of the whole must-know-how of Drupal.
In this course you will learn how to use the Views in order to edit the existing lists inside of a Drupal web site and also how to present new lists with your content.
We will go thought all the main tools and settings of the Views interface and I will show you as much examples as possible right away.
- PHP Drupal Developer with more than 7 years of experience
- I love to teach Drupal
- What is Views and how to work with it’s interface
- How to edit the default views that come out of the box with Drupal
- How to create new Views
- covering the basics and some advanced topics
- as much examples as possible
Installing Acquia Dev Desktop
Acquia Dev Desktop contains
And enables us to install Drupal with several clicks
Install Drupal locally
Download the Devel module
Activate the Devel Generate module
Interface for building lists of content
a query builder
a tool with which you may create dynamic listings
The Views module allows administrators and site designers to create, manage, and display lists of content. Each list managed by the Views module is known as a view, and the output of a view is known as a display.
You need Views if
You like the default front page view, but you find you want to sort it differently.
You want to add column to the Content overview page
You want to add a filter to the Content overview page
You want a way to display a block with the 5 most recent posts of some particular type.
You want to create a new page with a list of some content
Lets see some examples to gain a better idea about what Views is
Admin Content page
Admin People page
Taxonomies Overview pages
We have a list of all the Views under Structure > Views
that’s the Views UI
here we can edit the existing ones and later add new
you may edit their look and structure as you like …
Lets see what are we actually fetching ?
What is an Entity
- building blocks, having unified structure
Example entities are:
- Taxonomy terms, etc
Creating our first view
Creating our first display
Views and Displays
Display Type - page
- format and fields, filters and sorts
- Middle column
- settings, header, footer, pager
- contextual filters, relations, caching and other nudges
First two are the kings:
And some more out of the box:
What is formats
- the way we want to render our list
- represents the HTML format that would be generated
There are some combinations of Formats and Row styles that make no sense at all
Mostly being used for administration pages
Edit and drop buttons are for here
Rendering either as Unordered or as Ordered list
View mode ( or Display Mode ) ?
activating another one
Using it in a View ( the Teaser Display Mode )
Let’s nudge a bit
- change some formatters
- remove some fields
The default one is the detail view of the Entity.
If needed we may create a new one.
Number of columns
The one that I personally use the most
We have a list. Let’s filter it !
Letting the user interact with the list
Filter as select
Filter as multiple select
Searching with form input
Change the Name of the filterable field
Change the parameter value
How the filters are interacting with each other
Sort that those results!
Sorting by sticky on top of the lists
Show stuff on top or at the bottom of our View.
Free text that we want to show
Empty node Frontpage behaviour
Render another view
Yes we may nudge that too!
Specified number of items
Display all items
Let’s briefly check Drupal 8 permissions:
What are drupal users
Let’s apply some to our View!
Access based on Permissions
Related to the current node or taxonomy
Related in a way to the current logged in user
Some custom field correlation
Apply validation criteria
That’s basically SQL joins
Why do we need that
Introduces new fields that we may use
Let’s make an example use case:
A reference to another entity - per say a User
A field that exists only there
Basic and input required - is about the starting point
Adding a reset button
Changing some form labels
Some words about Drupal Blocks
Expose our exposed filters to a block form
What is Ajax ?
Let’s activate it
What is Caching ?
Don’t apply to all most of the time (be careful)
Organize to make your life and the life of your co-workers easier
Clone a display to something else (a wonderful feature)
Choose the root path
Create a fields page
Access for the page
Build our view
Block specific settings
Blocks overview and placing our block
Let’s show the first 3 results a bit better
Let’s apply it to a page
Some words about Drupal fields
Let’s create an Entity Reference field
Let’s create a Entity Reference view
Other than the videos that are published here are some more videos that you will get, starting from September
Videos that are coming:
Section: Great Custom Modules
In this section we will install custom modules and we will bring in new bells and whistles to Views.
Section: Example: A front page with contents
In this section we will create a whole front page with the different sections of it.
Highly dedicated developer with a true passion for programming. In my work I am taking care of every aspect of the Drupal Application’s functionality. I love to teach Drupal at my work and in any other possible occasions.
I have a masters degree in IT and I am working as PHP developer for over 8 years and as Drupal PHP developer for more than 5 years.
Other technologies that I really love are Elastic Search, Varnish, MongoDB, Mink/Behat, Python ...