Viewing 0 reply threads
  • Author
    Posts
    • #1636
      quethenoo
      Member

      Hi All

      Is it possible to have conditional fields within a group? I have tried the fields out of the group and they appear to work but no luck inside. Is it my code or just not possible?

      
      piklist('field', array(
      	'type' => 'group'
          ,'field' => 'drinks_menu_group'
          ,'add_more' => true
          ,'label' => __('Drinks Set Menu')
          ,'description' => __('Add items to the lunch menu. Use the plus and minus buttons to add and remove items, you can also drag and drop each item to change the display order.')
          ,'fields' => array(
      		array(
      			'type' => 'text'
      			,'field' => 'drinks_menu_cat'
      			,'columns' => 7
      			,'label' => __('Drinks menu category e.g. "Red Wine, Cocktails"')
      		)
      		,array(
      			'type' => 'select'
      			,'field' => 'drinks_menu_cat_cols'
      			,'columns' => 5
      			,'label' => __('No. of additional information columns')
      			,'value' => '1'
      			,'choices' => array(
      				'1' => '1 Column'
      				,'2' => '2 Columns'
      				,'3' => '3 Columns'
      			)
      		)
      		,array(
      			'type' => 'text'
      			,'field' => 'drinks_menu_cat_col1_title'
      			,'columns' => 4
      			,'label' => __('Additional Column 1 Title')
      			,'conditions' => array(
      				array(
      					'field' => 'drinks_menu_cat_cols'
      					,'value' => '1'
      				)
      			)
      		)
      		,array(
      			'type' => 'text'
      			,'field' => 'drinks_menu_cat_col2_title'
      			,'columns' => 4
      			,'label' => __('Additional Column 2 Title')
      			,'conditions' => array(
      				array(
      					'field' => 'drinks_menu_cat_cols'
      					,'value' => '2'
      				)
      			)
      		)
      		,array(
      			'type' => 'text'
      			,'field' => 'drinks_menu_cat_col3_title'
      			,'columns' => 4
      			,'label' => __('Additional Column 3 Title')
      			,'conditions' => array(
      			   array(
      				'field' => 'drinks_menu_cat_cols'
      				,'value' => '3'
      			   )
      			)
      		)
      		,array(
      			'type' => 'group'
      			,'add_more' => true
      			,'field' => 'drinks_menu_group_items'
      			,'fields' => array(
      				array(
      					'type' => 'text'
      					,'field' => 'ldrinks_menu_group_item_description'
      					,'columns' => 8
      					,'label' => __('Drinks menu item specifics e.g. "Edamame spicy (v)"')
      				)
      				,array(
      					'type' => 'text'
      					,'field' => 'drinks_menu_group_item_number'
      					,'columns' => 4
      					,'label' => __('Drinks menu item number')
      				)
      			)
      		) 
      
      	)
      ));
      
Viewing 0 reply threads
  • You must be logged in to reply to this topic.