Use case :
"block_type" is a selector for a block. Then onece block is selected, you should select block no. for selected block type. (I do not put all types, there are over 10 types.) Fields for block no. which not selected should be hidden. So I use conditional fields.
Note: This code is not in use, because if there more than two different types appears in records, it display strange in header and not showing active record of select-dropdown. So just take this sample is just sample codes for conditional fields. So it better to hack stacked-layout into not-stacked-layout using bootstarp class.(ex delete row, col-md-10 -> col-md-2 )
- Code: Select all
label="Please select a block type."
opt_values='calltoaction | content | counter | features | footer'
opt_selected = 'calltoaction'
<cms:func _into='is_show' block_type=''>
<cms:if block_type='calltoaction'>show<cms:else />hide</cms:if>
var $target_th = $form.find("th.k_element_block_selected_" + var_block_type);
var $target_td = $form.find("td.editable.k_element_block_selected_" + var_block_type);
label="Please select a block No.(calltoaction)"
opt_values='01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15'