In this series we will create a custom frontpage that introduces all the main concepts of the Views module. We will cover topics such filters, sorting, displays, exposed filters, contextual filters and relationships.
Note: the video usually has more explanations and examples.
Create Dummy Content With Devel Module
Let’s first create some dummy content.
- Go to Devel Module Page.
- Right-click the Drupal 8 version download link and select Copy Link Location.
- Go to Extend and click + Install new module.
- Paste the link in the Install from a URL input.
- Click Enable newly added modules and enable the Devel and Devel generate module.
- Go to Configuration > Development and generate some users, terms and content (articles) (in this order) with default settings.
Now you see article teasers listed in the frontpage:
Add New View And Set Default Homepage
- Go to Structure > Views and click +Add new view.
- Write the View name : Home.
- Select the type as Article:
- Check Create a page checkbox:
- Hit Save and edit.
- Click View Page button in the View configuration page and you can see the view working in the /home url:
- Go to Configuration > System > Site information and change the Default front page URL to /home:
- Click Save configuration.
The view so far:
Custom Home view as the default Homepage:
Posted by Samuli Natri on 18 November 2015