When you create a
database join element in another list which points to the current list you are editing (e.g. you create a 'country'
Database join element in the 'regions' list), Fabrik can automatically provide 'related data' links in
Lists and
Forms.
Settings
The related data section becomes populated as follows:
- Show related Add -
- Setting this to Yes will always show an Add link
- setting to NO will NEVER show an add link
- Setting to ONLY IF EMPTY will show the add link only if the record count is 0.
- Show related data link - If this form's table has related data links set up, and you select yes for this option then each of those related data links will also appear at the top of the form
- Table - the table that contains a Database join element pointing to the current table you are editing
- Link to list - if you select 'yes' then a column will be added to your table. This column will contain a link which will take you to the related table, filtering its results based on the current row's primary key.
E.g:
Your table is called 'Countries' and the related table is 'Regions'
Regions has a Database join element to list which country it belongs to
Activating the 'Regions' link to table option will create a link which for each listed country will show its associated regions
- Heading- the link to table's label - e.g. 'Regions'
- Button text - the text that appears in each cell - can use {Placeholders}
- Popup-
- No - the link will open in the same page
- Yes - the link will open in a popup window
- Link to form - creates a new column with a link to the related table's form. The Database join element will be pre-filled with the active records value.
E.g.
Your table is called 'countries' and the related table is 'regions'
For the country 'UK' You click on the link 'add region'
The regions form appears and its 'country' Database join element is pre-filled with UK as the desired country.
- Heading- the link to form's heading- e.g. 'Add a region'
- Button text- the link to form's label - e.g. 'add a region to {countries___label}'. You can use {Placeholders}
- Popup -
- No - the link will open in the same page
- Yes - the link will open in a popup window
Below is an example of the two related data columns: