
Me:
- PHP Drupal Developer with more than 7 years of experience
- I love to teach Drupal
The course:
- 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
Apache
MySQL
PHP
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
Documentation version:
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
Front page
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
- fieldable
Example entities are:
- Nodes
- Users
- Taxonomy terms, etc
Creating our first view
Creating our first display
Views and Displays
Display Type - page
Left column
- format and fields, filters and sorts
- Middle column
- settings, header, footer, pager
Advanced
- contextual filters, relations, caching and other nudges
First two are the kings:
Page
Blocks
And some more out of the box:
Attachment
Entity Reference
Feed
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
Sortable columns
Edit and drop buttons are for here
Rendering either as Unordered or as Ordered list
View mode ( or Display Mode ) ?
existing
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
Alignment
The one that I personally use the most
We have a list. Let’s filter it !
Status
Type
Search
Language
Letting the user interact with the list
Filter as select
Filter as multiple select
Searching with form input
Combine
More:
Change operator
Change the Name of the filterable field
Change the parameter value
How the filters are interacting with each other
Filter groups
Rearrange
Sort that those results!
Publish date
Sorting by sticky on top of the lists
Show stuff on top or at the bottom of our View.
Result summary
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
Full pager
Let’s briefly check Drupal 8 permissions:
What are drupal users
Roles
Permissions
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
Default value
Apply validation criteria
Multiple values
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
Ajaxed pager
What is Caching ?
Tag based
Views settings
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
Page title
Create a fields page
Access for the page
Block name
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
Attachment position
Some words about Drupal fields
Let’s create an Entity Reference field
Let’s create a Entity Reference view
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.