How to use collection data in a List
Please read the tutorial How to: Create a backoffice to manage collections first.
Let's configure 2 linked lists : a list of car brands, and a list of car names from the selected brand.
As configured in the collection cars (cf tutorial), items are stored in that way:
The list of brands is already created : it's 'Car - brands'.
What we have to configure is a dynamic list of cars, that is populated from this collection every time the selected brand has changed.
In the dynamic list of cars, label will be 'Name' and the value will be 'Car ID'.
Let's configure a new webinterface 'Car Order':
Go to Collections tab:
- plug the collection cars (1)
- the identifier will be col_cars (2)
Go to Design tab:
- Add a widget list Brand (1)
- type custom list : select 'Car - brands'
- value variable : brand_id
- label variable brand_label
- Add a widget list Name (2)
- type variable based
- value variable : car_id
- label variable : car_name
- List variable : vb_car*
- Add a hidden split widget (3)
- In this split widget add a widget js (4)
- rename it 'listen brand_id'
- Listen to variables : brand_id
- Add the script below
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
It's done. Give it a try!