Tagged: ,

Viewing 6 reply threads
  • Author
    Posts
    • #2112
      ianmuscat
      Member

      Hi,

      I’m trying to create a metabox that has an ‘editor’ field within an advanced ‘add more’ field, however, I’m getting the rest of my fields at the top and the ‘editor’ at the bottom (outside of the add more field). Is the editor not able to be part of an add more field, and if not, is there something specific that needs to be done to get this to work properly?

      Kindly let me know if you require any further information.

      Thanks in advance,
      Ian

    • #2113
      ianmuscat
      Member

      It seems like someone else has encountered this issue (https://piklist.com/support/topic/text-editor-add_more-issue/).

      Is there a temporary fix that I can use until this bug gets corrected?

      Thanks once again and apologies for double-posting – I did not come across the aforementioned topic earlier.

      Regards,
      Ian

    • #2114
      Steve
      Keymaster

      Please post your code. This bug has already been fixed.

    • #2118
      ianmuscat
      Member

      Hi Steve,

      Thanks for your quick reply. Kindly take a look at my code below.

      <?php
      /*
      Title: My Piklist Test
      Description: My Description
      Post Type: piklist_test
      Order: 1
      Lock: true
      Collapse: true
      */
      
      piklist('field', array(
         'type' => 'group'
        ,'field' => 'piklist_test_addmore'
        ,'add_more' => true
        ,'fields' => array(
      
      array(
         'type' => 'text'
        ,'field' => 'piklist_test_title'
        ,'label' => __('Title','piklist')
        ,'description' => __('Enter a title for this test.','piklist')
        ,'help' => __('Enter a title for this test.','piklist')
        ,'attributes' => array(
          'class' => 'large-text'
          ,'placeholder' => __('Enter title here','piklist')
        )
        ,'on_post_status' => array(
          'value' => 'lock'
        )
        ,'sanitize' => array(
        array(
          'type' => 'title'
          ,'context' => 'save'
        )
      )
      )
      ,array(
        'type' => 'editor'
        ,'scope' => 'post'
        ,'field' => 'piklist_test__content'
        ,'label' => __('Test Content','piklist')
        ,'description' => __('Enter content for this test.','piklist')
        ,'help' => __('Enter content for this test','piklist')
        ,'value' => '<h1>Headline.</h1><p>Some text here.</p>'
        ,'options' => array (
          'wpautop' => false
          ,'media_buttons' => true
          ,'tinymce' => true
          ,'quicktags' => true
        )
      )
      
      ,array(
        'type' => 'file'
        ,'field' => 'piklist_test_media'
        ,'scope' => 'post_meta'
        ,'label' => __('Add Media','piklist')
        ,'description' => __('Add media for this test.','piklist')
        ,'help' => __('Add media for this test','piklist')
        ,'options' => array(
          'modal_title' => __('Add Test Media','piklist')
          ,'button' => __('Add Media','piklist')
        )
        ,'validate' => array(
          array(
            'type' => 'limit'
            ,'options' => array(
              'min' => 1
              ,'max' => 1
            )
          )
        )
      )
      
      ,array(
        'type' => 'colorpicker'
        ,'scope' => 'post_meta'
        ,'field' => 'piklist_test_color'
        ,'label' => __('Test Color','piklist')
        ,'description' => __('Select a color for this test','piklist')
        ,'help' => __('Select a background color for this test','piklist')
        ,'attributes' => array(
          'class' => 'text'
        )
      )
      
      ,array(
        'type' => 'select'
        ,'field' => 'piklist_test_option'
        ,'value' => 'option-1' // Sets default to option-1
        ,'label' => __('Test Layout','piklist')
        ,'description' => __('Choose an option for this test','piklist')
        ,'attributes' => array(
          'multiple'
        )
        ,'choices' => array(
          'option-1' => __('Option 1','piklist')
          ,'option-2' => __('Option 2','piklist')
        )
      )
      
      )
      ));

      Thanks once again,
      Regards,

      Ian

    • #2119
      Steve
      Keymaster

      @ianmuscat– We added an enhancement to Editors within groups. Download Piklist 0.9.4.6. Let us know if that fixes your issue.

    • #2120
      ianmuscat
      Member

      Indeed it did – thank you so much for your help.

    • #2121
      Steve
      Keymaster

      Awesome! Closing this ticket.

Viewing 6 reply threads
  • The topic ‘'Editor' field within an 'Add More' field’ is closed to new replies.