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 blog entry was a part of the portfolio database by using the "connected" filter.

 

 

Step 1: Add a database list to the blog database component

Go to the database components and click on blog article to go to the form builder.

Screenshot_191-2

 

Click the single item structure. Be sure this is a single item, indicated by the circle.

Screenshot_175

 

Select Database List and click Add Component.

Screenshot_176-2

 

Step 2: Database List Setup

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

Screenshot_177-1

 

Setup works as described in the database list article:

Screenshot_192-2

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

Screenshot_179-1

 

Step 3: Database component code

In the code editor add the [:renderlist:#ID:] code using the triple dots icon next to our single item.

Screenshot_181

 

As you can see in the example below we added the renderlist to the component.

Screenshot_193-2

Step 4: Edit entry

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

Screenshot_187-2

 

 Pick a Team Member.

Screenshot_195-2

(1) Setup the the entry

(2) Select the category of the list

(3) Open the Team Member database and pick the entry

(4) 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)