Monday, September 7, 2020

Using Drupal 8 to expose database fields to Views

There are two tables in this database each with four fields.  The objective of this project was to extract the information in those fields using Views.  Because data in the table fields are different, the tables had to be joined in order to extract the information from both table fields.  The relationship feature of Views was used for this. 

To get going, a new view was created in the Admin->Structure->Views menu.  A table was created in Views and the database table fields were extracted and added to the Views table.  The table below shows the result using Views.  The information was organized as follows: player ID, player name, team ID, team name and team description.  A pager was added to the Views table set to allow 8 items per page.

Provisions were included for filters and sorters to be applied to the extracted data.

Views table showing data from two joined database tables


No comments:

Post a Comment