Viewing 5 reply threads
  • Author
    Posts
    • #8599
      jasondalycan
      Participant

      Hi,
      I noticed that when adding fields, if a group is added, then a normal (non-group) field is added afterwards that the non-group field renders before the group field.

      See the following modified code from the Piklist Demos and the attached screenshot — the ‘ingredient_type1’ field renders before the group that precedes it:
      ———————————————————————–

      piklist(‘field’, array(
      ‘type’ => ‘group’
      ,’field’ => ‘ingredient_section’
      ,’label’ => __(‘Ingredients’, ‘piklist-demo’)
      ,’add_more’ => true
      ,’fields’ => array(
      array(
      ‘type’ => ‘text’
      ,’field’ => ‘ingredients_component_title’
      ,’label’ => __(‘Ingredient Title’, ‘piklist-demo’)
      ,’columns’ => 12
      )
      ,array(
      ‘type’ => ‘checkbox’
      ,’field’ => ‘ingredient_type’
      ,’columns’ => 12
      ,’list’ => false
      ,’label’ => __(‘Meal Type’, ‘piklist-demo’)
      ,’choices’ => array(
      ‘appetizer’ => __(‘Appetizer’, ‘piklist-demo’)
      ,’entree’ => __(‘Entree’, ‘piklist-demo’)
      ,’main_course’ => __(‘Main Course’, ‘piklist-demo’)
      )
      )
      ,array(
      ‘type’ => ‘group’
      ,’field’ => ‘ingredient’
      ,’add_more’ => true
      ,’fields’ => array(
      array(
      ‘type’ => ‘text’
      ,’field’ => ‘ingredient_qty’
      ,’label’ => __(‘Qty’, ‘piklist-demo’)
      ,’columns’ => 2
      )
      ,array(
      ‘type’ => ‘textarea’
      ,’field’ => ‘ingredient_description’
      ,’label’ => __(‘Description’, ‘piklist-demo’)
      ,’columns’ => 10
      ,’attributes’ => array(
      ‘rows’ => 5
      )
      )
      )
      )
      ,array(
      ‘type’ => ‘checkbox’
      ,’field’ => ‘ingredient_type1′
      ,’columns’ => 12
      ,’list’ => false
      ,’label’ => __(‘Meal Type’, ‘piklist-demo’)
      ,’choices’ => array(
      ‘appetizer’ => __(‘Appetizer’, ‘piklist-demo’)
      ,’entree’ => __(‘Entree’, ‘piklist-demo’)
      ,’main_course’ => __(‘Main Course’, ‘piklist-demo’)
      )
      )
      )
      ));

      Attachments:
      You must be logged in to view attached files.
    • #8604
      Steve
      Keymaster
    • #8624
      jasondalycan
      Participant

      Thanks, although I tried 0.10 and the issue persists.

    • #8644
      Steve
      Keymaster

      @jasondalycan– So, you want the second Meal Type field to appear after the ingredient add-more?

    • #8645
      jasondalycan
      Participant

      Yes correct. Is there a way to do this?

    • #8646
      Steve
      Keymaster

      Not now.

      The field is part of the main add-more, so it will show up there. There is no way to split an add-more.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.