Given:
A module that keeps the job items
Each item represents a job of certain type: Print, TV, Web etc.
Fields present in the item:
Field Name | Field Content | Field Type | Values | Note |
---|---|---|---|---|
Job Name | Text | Text |
| Base field |
Job Type | Text | Selectbox |
| Base field |
Paper size | Text | Text |
| Related to job type “Print” |
Artwork | Text | Text |
| Related to job type “Print” |
TV channel | Text | Selectbox |
| Related to job type “TV” |
Broadcast | Date | Date-Time |
| Related to job type “TV” |
Needed:
When creating a new job or editing existing one, user should see only the fields, that are relevant to the chosen job type.
Configuration steps:
Create field templates and configure the field visibility for them:
! Note that Base Template configuration is not needed for v.15+. Base fields are configured in item view configuration.
Module > Field TemplatesModule > Field Usage > Templates
(!For versions before v.15! )Assign Base template in Module > Settings > Field Template for Add/Edit Item.
Assign Print template and TV template to corresponding options in Module > Field definition > Job Type. Leave the option “Web” without any template assigned.
For v.15+: Fields that are configured to be shown by dynamic forms should not be present in item view configuration.
Go to module search result and try to create a new item.
As a result you will see that initially only 2 base fields are shown in Add Item window: Job Name and Job Type. Selecting a value in Job Type selectbox (e.g. Print), will additionally show the fields Paper size and Artwork related to print job type. If you change the job type to TV, fields related to print will be hidden and TV channel and Broadcast shown instead. Selecting job type Web will not show any additional fields just hide not relevant, since this option has no specific template assigned and inherit the Base template.