Support Forum ยป User Profile

Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: Nested groups problem #3978
    wefit.lucaswefit.lucas
    Participant

    Yep. I don't want that to change. I think that its the expected behavior, but I think that I should not me able to drop the element outside its parent like I am as of today.

    in reply to: Nested groups problem #3946
    wefit.lucaswefit.lucas
    Participant

    Worked here as well, thanks.

    Anh, I'm having another problem (but it was there before your update). In the same code example, when you create the nested cloneable groups it is possible to sort and drag them anywhere, like for example move a child to same level as its parent or even move a child to a different parent. Once you move it, it'll break the Add clone button and I'm assuming it will mess up with the data in the JSON. Is there a way to avoid that?

    Thanks.

    in reply to: Checkbox Values #3907
    wefit.lucaswefit.lucas
    Participant

    Alright, got it.

    Thanks.

    in reply to: Nested groups conflict #3896
    wefit.lucaswefit.lucas
    Participant

    Updated here, the conditional logic seems to be working now. Thanks Tan.

    Still waiting for the group problem. I'm still able to delete all groups in this code example. How can I fix this?

    Thanks.

    in reply to: Nested groups conflict #3853
    wefit.lucaswefit.lucas
    Participant

    Hi Anh,

    Thanks for the response. I'm currently using the conditional-logic v1.3 and metabox group v1.1.4.

    in reply to: Template on Select2 #3852
    wefit.lucaswefit.lucas
    Participant

    These options worked, thanks. But I'm still having troubles with the templating. I don't know much PHP, so I'm having trouble to understand how this parameter would work. Taking your code as example:

    add_filter( 'rwmb_meta_boxes', 'your_prefix_select_demo' );
    function your_prefix_select_demo( $meta_boxes ) {
    	$meta_boxes[] = array(
    		'title' => __( 'Select Field Demo', 'your-prefix' ),
    		'fields' => array(
    			array(
    				'name'       => __( 'Select Advanced', 'your-prefix' ),
    				'id'         => 'select_advanced',
    				'type'       => 'select_advanced',
    				'options'    => array(
    					'value1' => __( 'Label1', 'your-prefix' ),
    					'value2' => __( 'Label2', 'your-prefix' ),
    				),
    				'js_options' => [
    					'placeholder' => 'Select whatever you want',
    					'allowClear'  => false,
    					'templateSelection'  => formatState,
    				],
    			),
    		),
    	);
    	return $meta_boxes;
    } 

    Being the formatState originally a JS function how am I supposed to use it? Should I pass the function call as a String and have it on a .js file or should I convert it to a PHP function? If I convert it to PHP function, how would I be able to get the 'state' object that is passed on the select2 example?

    Sorry for the trouble. thanks.

    in reply to: Template on Select2 #3838
    wefit.lucaswefit.lucas
    Participant

    Actually, I don't think the option js_options is working at all. Just tried adding allowClear and placeholder properties and it is still rendering with the default options (data-options="{"allowClear":true,"width":"none","placeholder":"Select an item"}"). Can you check, please? Tks.

    in reply to: Cloneable group with WYSIWYG #3824
    wefit.lucaswefit.lucas
    Participant

    Apparently the problem starts on the second level group:

    $meta_boxes[] = array(
          'title'      => __( 'Content', 'textdomain' ),
          'id'         => 'myContent',
          'post_types' => 'rep_page',
          'fields'     => array(
            //----  Select Component Type Metabox  ----//
            array(
              'id' => 'content',
              'type' => 'group',
              'clone' => true,
              'sort_clone' => true,
              'fields' => array(
                array(
                  'id'   => 'myTitle',
                  'name' => __( 'Title', 'textdomain' ),
                  'type' => 'text',
                  'placeholder' => 'Title',
                ),
                array(
                  'id'   => 'myText',
                  'name' => __( 'Text', 'textdomain' ),
                  'type' => 'wysiwyg',
                  'options' => array(
                    'media_buttons' => false,
                    'textarea_rows' => 6,
                    'teeny' => true,
                  ),
                ),
                array(
                  'id'   => 'myGroup',
                  'type' => 'group',
                  'clone' => true,
                  'sort_clone' => true,
                  'fields' => array(
                    array(
                      'id'   => 'myText2',
                      'name' => __( 'Text', 'textdomain' ),
                      'type' => 'wysiwyg',
                      'options' => array(
                        'media_buttons' => false,
                        'textarea_rows' => 6,
                        'teeny' => true,
                      ),
                    ),
                  ),
                ),
              ),
            ),
          ),
        );
Viewing 8 posts - 1 through 8 (of 8 total)