Support Forum Β» User Profile

Forum Replies Created

Viewing 15 posts - 2,716 through 2,730 (of 3,958 total)
  • Author
    Posts
  • in reply to: Core Extensions Bundle refund. #6353
    Anh TranAnh Tran
    Keymaster

    Hi uththamag,

    As Tan said in the previous reply, each field belongs to 1 column, so hiding a column probably break the layout unless we use a trick like above.

    In the next couple of days, I will work on allowing multiple fields in a column, so you can hide/show them without problem. Please be patient.

    Thanks
    Anh

    in reply to: Core Extensions Bundle refund. #6352
    Anh TranAnh Tran
    Keymaster

    You're right. The Columns extension will wrap fields on 12 grid. That means two wysiwyg editors are in the same row and the remaining in the same row. There is a trick to wrap 3 columns in the same row, by setting the second column to column of 5 instead of 6:

    
    array(
    	'name'    => false,
    	'id'      => "{$prefix}sect_editor",
    	'type'    => 'wysiwyg',
    	'columns' => 6,
    	'raw'     => true,
    	'options' => array(
    		'textarea_rows'     => 15,
    		'wpautop'         => false,
    	),
    ),
    
    array(
    	'name'    => false,
    	'id'      => "{$prefix}sect_editor2",
    	'visible' => ['uk_sect_layout', 'layout2'],
    	'type'    => 'wysiwyg',
    	'columns' => 5,
    	'raw'     => true,
    	'options' => array(
    		'textarea_rows'     => 15,
    		'wpautop'         => false,
    	),
    ),
    
    // Image Columns
    array(
    	'name'             	=> esc_html__( 'Section Images', 'codice' ),
    	'id'               	=> "{$prefix}sect_image",
    	'visible'          	=> ['uk_sect_layout', 'layout1'],
    	'type'             	=> 'image_advanced',
    	'columns' 			=> 6,
    	'force_delete'     	=> false,
    	'max_file_uploads' 	=> 2,
    	'max_status'       	=> false,
    ),
    
    // Layout options
    array(
    	'name'    => esc_html__( 'Layout', 'codice' ),
    	'id'      => "{$prefix}sect_layout",
    	'columns' => 3,
    	'type'    => 'select',
    	'options' => array(
    		'layout1' => esc_html__( 'Image', 'codice' ),
    		'layout2' => esc_html__( '2 Columns', 'codice' ),
    	),
    ),
    

    Please try and let me know if you have any problem.

    Cheers!

    in reply to: βœ…Strange issue with tabs + columns #6349
    Anh TranAnh Tran
    Keymaster

    We just updated the Columns extension yesterday with a better check for total columns (less than or greater than 12, it will close the div). But if you use with tabs, you still need to make sure total columns in each row equals to 12. Please update.

    Regarding the new syntax, I was thinking about something advanced that can offer you more flexibility. But after looking at that, I see the change is only the fields parameter (the class as I replied can be achieved via class attribute). And with the support of Group extension, you can do that easily, including the nested columns.

    Here is what you can do with Groups (the syntax is very similar):

    'fields' => array(
        array(
            'type' => 'group', // A wrapper group
            'id' => 'wrapper',
            'fields' => array(
                array(
                    'id' => 'name',
                    'type' => 'text',
                    'columns' => 4
                ),
                array(
                    'id' => 'subgroup',
                    'type' => 'group',
                    'columns' => 8,
                    'fields' => array(), // Array of other sub-sub fields
                )
            ),
        ),
    ),
    in reply to: Core Extensions Bundle refund. #6346
    Anh TranAnh Tran
    Keymaster

    Dear uththamag,

    Sorry to make you feel confusing, I've checked both Columns and Conditional Logic and see it works as your requested. Please see my example and let me know if you have further problems.

    Anh TranAnh Tran
    Keymaster

    Dear uththamag,

    Imagine you have a field to select layout like so:

    
    array(
    	'name'    => __( 'Layout', 'rwmb' ),
    	'id'      => 'layout',
    	'type'    => 'select',
    	'columns' => 12,
    	'options' => array(
    		'one' => '1 Col', 
    		'two' => '2 Cols',
    		'three' => '3 Cols'
    	)
    ),
    

    To toggle a field with selected value, just add:

    
    'visible' => ['layout', 'SELECTED_VALUE'],
    

    SELECTED_VALUE can be one, two, or three like the above example.

    Anh TranAnh Tran
    Keymaster

    Dear xoomserve,

    Here is the example which I've created with MB Builder:

    
    add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
    
    function your_prefix_register_meta_boxes( $meta_boxes ) {
    
        $meta_boxes[] = array (
          'id' => 'untitled-metabox-2',
          'title' => 'Untitled Metabox',
          'pages' =>   array (
             'post',
             'page',
          ),
          'context' => 'normal',
          'priority' => 'high',
          'autosave' => false,
          'fields' =>   array (
             
            array (
              'id' => 'properties',
              'type' => 'taxonomy',
              'name' => 'Properties',
              'taxonomy' => 'product_type',
              'field_type' => 'select',
            ),
             
            array (
              'id' => 'another_text_field',
              'type' => 'text',
              'name' => 'Text Field',
              'visible' =>       array (
                'when' =>         array (
                  array (
                     'taxonomy_2',
                     '=',
                     '4',
                  ),
                ),
                'relation' => 'and',
              ),
            ),
          ),
        );
    
        return $meta_boxes;
    }
    

    Basically, you can register your taxonomy field and another field normally. And then, in related field (Text in this example), just define your conditional logic:

    
    'visible' => ['your_taxonomy_id', '=', 'taxonomy_value']
    
    in reply to: admin columns not working #6339
    Anh TranAnh Tran
    Keymaster

    Hi,

    How do you setup the columns to show?

    in reply to: βœ…Strange issue with tabs + columns #6333
    Anh TranAnh Tran
    Keymaster

    Hi, I don't want to much nested arrays. In case sub-fields in groups are organized in columns, there will be a nightmare of nested nested arrays.

    After reviewing the code, I think we can still achieve everything by this code:

    fields => array(
        array(
            'columns' => 4,
            'class'   => 'custom-column-class',
        ),
    ),

    We have class attribute for fields, so let's use it instead of creating another attribute.

    in reply to: βœ…Strange issue with tabs + columns #6326
    Anh TranAnh Tran
    Keymaster

    Hi Jackky,

    Your idea about column class is nice. Will think about it. The suggested syntax I think will be problematic if we use with groups. So let's just keep it as it is.

    in reply to: Options escaping quotes #6325
    Anh TranAnh Tran
    Keymaster

    Thanks a lot. Just fixed the bug with the editor!

    Cheers
    Anh

    in reply to: Save button label #6309
    Anh TranAnh Tran
    Keymaster

    Just added 2 options submit_button and message for you πŸ™‚

    in reply to: Send email get_post_meta #6308
    Anh TranAnh Tran
    Keymaster

    Hi,

    I guess the problem is when you hook send_mails_on_publish. Probably it's hook too soon, sooner when Meta Box updates post meta.

    Currently Meta Box uses save_post_{$post_type} with priority = 10 to save post meta. You should hook after that (at save_post or at the same hook with higher priority).

    Looking at the function params, I think you're using transition_post_status. It's fired in wp_transition_post_status function that runs before save_post_* hook.

    in reply to: Options escaping quotes #6307
    Anh TranAnh Tran
    Keymaster

    Somehow my code that remove slashed was removed from the released version. Probably it was an error while merging. I've just pushed a fix for that. Also added 2 options: submit_button and message for the text of submit button and successful message.

    Please update.

    PS: Can you post the screenshot of your screen when replying this thread? Don't you see any button in the reply box?

    in reply to: Options escaping quotes #6299
    Anh TranAnh Tran
    Keymaster

    Hmm, can you post your full code here to check? Also, what is your PHP version and OS?

    in reply to: Collapsible Attribute #6298
    Anh TranAnh Tran
    Keymaster

    I understand the issue. It’s what I designed to work like that. I will update the group to maintain the collapsible state.

Viewing 15 posts - 2,716 through 2,730 (of 3,958 total)