Tagged: 

Viewing 1 reply thread
  • Author
    Posts
    • #1545

      Hi,
      I’m trying to show a field based on whether the control field is either choice A or choice B but not choice C.
      However this is not working.
      See Code

      piklist('field', array(
          'type' => 'radio'
          ,'scope' => 'post_meta'
          ,'field' => 'page_layout'
          ,'value' => 'no-sidebar' 
          ,'label' => __( 'SELECT LAYOUT', 'cjwd' )
          ,'attributes' => array(
            'class' => 'text'
          )
          ,'choices' => array(
            'left-sidebar' => 'Left Sidebar'
            ,'right-sidebar' => 'Right Sidebar'
            ,'no-sidebar' => 'Without Sidebar'
          )
      ));
      
      piklist('field', array(
          'type' => 'select'
          ,'scope' => 'post_meta' // Not used for settings sections
          ,'field' => 'assigned_sidebar'
          ,'value' => '' 
          ,'label' => __('ASSIGN SIDEBAR', 'cjwd')
          ,'description' => __( 'Select a sidebar to display on this page', 'cjwd' )
          ,'choices' => piklist(
            $GLOBALS['wp_registered_sidebars']
            ,array(
              'id'
              ,'name'
              )
          )
          ,'conditions' => array(
             array(
              'field' => 'page_layout'
              ,'value' => 'right-sidebar'
             )
             ,array(
               'field' => 'page_layout'
               ,'value' => 'left-sidebar'
              )
          )
      ));
    • #1550
      Steve
      Keymaster

      Piklist doesn’t support multiple conditions… yet. It’s on our feature list, but currently not available. Sorry.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.