Read the previous article where we added a database filter to our portfolio database component. In this article we are going to add a database list that renders all portfolio items where a person was a part of the team (the filter we used).
Step 1: Add a database list to the people database component
Go to the database components and click on the person component to go to the form builder.
Click the single item structure
Select Database List and click Add Component.
Step 2: Database List Setup
Click on the Database List component you just added to enter the set-up.
Setup works as described in the database list article:
(1) Select the database you want the list to render
(2) Click Auto Create Vars to get the database input variables
(3) Add HTML code for a single list item
(4) Click save
Go back to the form structure
Click Code Editor to return to the detail page HTML code.
Step 3: Database component code
In the code editor add the renderlist code using Auto Create Vars
(1) Click Auto Create Vars
(2) Click Add Code Below
As you can see in the example below we added the renderlist to the component.
Step 4: Edit entry
Go to the CMS database management page of the people database and edit one of the entries.
Edit the database list as previously discussed in the CMS articles:
(1) Setup the the database
(2) Select the category of the list
(3) Open the Team database filter and pick the name of the person
(4) Here come the picked entries
(5) Click save
Step 5: Example result
Here is a result output of a connected database. In the detail page of the person we see a list of all the portfolio items where he was assigned to the team filter.
(1) database list filtered by another database (portfolio)