Connected Databases: list example

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.

step1-17

Click the single item structure

step2-22

Select Database List and click Add Component.

step3-21

Step 2: Database List Setup

Click on the Database List component you just added to enter the set-up.

step4-14

Setup works as described in the database list article:

step5-12

(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.

step6-9

Step 3: Database component code

In the code editor add the renderlist code using Auto Create Vars

step7-5

(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.

step8-2

Step 4: Edit entry

Go to the CMS database management page of the people database and edit one of the entries.

step9-2

Edit the database list as previously discussed in the CMS articles:

step10-2

(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.

step11-2

(1) database list filtered by another database (portfolio)