Support Forum ยป User Profile

Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: Using oEmbed field and warning message #4932
    VenkatVenkat
    Participant

    Is there any update on this issue? Here is full code

    <?php
    	public function add_meta_boxes( $meta_boxes ) {
    		
    		$flexslider_fields = array(
    			array(
    				'id'      => '_gx_flexslider_type',
    				'name'    => __( 'Type', 'genex-framework' ),
    				'type'    => 'radio',
    				'options' => array(
    					'image' => __( 'Image', 'genex-framework' ),
    					'video' => __( 'Video', 'genex-framework' ),
    					'map' => __( 'Google Map', 'genex-framework' ),
    				),
    				'std'     => 'image',
    			),
    			array(
    				'id'      => '_gx_flexslider_video',
    				'name'    => __( 'Video', 'genex-framework' ),
    				'type'    => 'oembed',
    				'hidden'  => array( '_gx_flexslider_type', '!=', 'video' )
    			), 
    			array(
    				'id'      => '_gx_flexslider_image',
    				'name'    => __( 'Image', 'genex-framework' ),
    				'type'    => 'image_advanced',
    				'max_file_uploads' => 1,
    				'hidden'  => array( '_gx_flexslider_type', '!=', 'image' )
    			),
    			array(
    				'id'      => '_gx_flexslider_map_type',
    				'name'    => __( 'Google Map type', 'genex-framework' ),
    				'type'    => 'radio',
    				'options' => array(
    					'iframe' => __( 'Embed iframe Link', 'genex-framework' ),
    					'api' => __( 'API Key', 'genex-framework' ), 
    				),
    				'hidden'  => array( '_gx_flexslider_type', '!=', 'map' )
    			),
    			array(
    				'id'   => '_gx_flexslider_map_embed',
    				'name' => __( 'Enter Google iframe link', 'genex-framework' ), 
    				'type' => 'text',
    				'hidden'    => array(  
    					'when' => array( 
    						array( '_gx_flexslider_type', '!=', 'map' ),
    						array('_gx_flexslider_map_type','!=', 'iframe'),
    					),
    					'relation' => 'or'
    				),
    			),  
    
    			// Map requires at least one address field (with type = text)
    			array(
    				'id'   => '_gx_flexslider_map_api',
    				'name' => __( 'Enter API Key', 'genex-framework' ), 
    				'type' => 'text',
    				'hidden'=> array(  
    					'when' => array( 
    						array( '_gx_flexslider_type', '!=', 'map' ),
    						array('_gx_flexslider_map_type','!=', 'api'),
    					),
    					'relation' => 'or'
    				),
    				'desc' => sprintf( __('Enter your <a href="%1$s" target="_blank">API key</a>. Your map may not function correctly without one.','genex-framework'),'https://developers.google.com/maps/documentation/javascript/get-api-key'),
    			),
    			array(
    				'id'   => '_gx_flexslider_address',
    				'name' => __( 'Address', 'genex-framework' ), 
    				'type' => 'text', 
    				'hidden'    => array(  
    					'when' => array( 
    						array( '_gx_flexslider_type', '!=', 'map' ),
    						array('_gx_flexslider_map_type','!=', 'api'),
    					),
    					'relation' => 'or' 
    				), 
    			), 
    			  
    			array(
    				'id'      => '_gx_flexslider_caption',
    				'name'    => __( 'Caption', 'genex-framework' ),
    				'type'    => 'wysiwyg', 
    				'options' => array(
    					'media_buttons' => false,
    					'quicktags'     => false,
    					//'textarea_rows' => 5
    				), 
    				'columns' => 12,
    			),
    
    		);
    
    		$meta_boxes[] = array(
    			'title'      => __( 'Slide', 'genex-framework' ),
    			'post_types' => array( 'flexslider' ),
    			'fields'     => array(
    				array(
    					'id'         => '_gx_flexslider_slide',
    					// Group field
    					'type'       => 'group',
    					// Clone whole group?
    					'clone'      => true,
    					// Drag and drop clones to reorder them?
    					'sort_clone' => true,
    					'fields'     => $flexslider_fields
    				),
    			)
    		);
    
    		// Caption settings
    		$meta_boxes[] = array( 
    			'title'      => __( 'Caption Settings', 'genex-framework' ),
    			'post_types' => array( 'flexslider' ),
    			'fields'     => array(
    				array(
    					'id'   => '_gx_flexslider_custom_caption',
    					'name' => __( 'Enable custom caption Settings', 'genex-framework' ),
    					'type' => 'checkbox',
    				),
    				array(
    					'id'     => '_gx_flexslider_caption',
    					'type'   => 'group',  
    					'hidden' => array('_gx_flexslider_custom_caption', false ),
    					'fields' => array(
    						array(
    							'id'   => '_gx_flexslider_caption_bg',
    							'name' => __( 'Caption background color', 'genex-framework' ),
    							'type' => 'color',
    						),
    						array(
    							'id'   => '_gx_flexslider_caption_color',
    							'name' => __( 'Caption font color', 'genex-framework' ),
    							'type' => 'color',
    						),
    						array(
    							'id'      => '_gx_flexslider_caption_alignment',
    							'name'    => __( 'Caption Alignment', 'genex-framework' ),
    							'type'    => 'select',
    							'options' => array(
    								'' =>  __( '-- Select alignment --', 'genex-framework' ),
    								'left'    => __( 'Left', 'genex-framework' ),
    								'right'   => __( 'Right', 'genex-framework' ),
    								'center'  => __( 'Center', 'genex-framework' ),
    								'justify' => __( 'Justify', 'genex-framework' ),
    							),
    							'std'     => '', // Todo
    						),
    						array(
    							'id'      => '_gx_flexslider_caption_transform',
    							'name'    => __( 'Text Transform', 'genex-framework' ),
    							'type'    => 'select',
    							'options' => array(
    								'' =>  __( '-- Select text transform --', 'genex-framework' ),
    								'capitalize'    => __( 'Capitalize', 'genex-framework' ),
    								'uppercase'   => __( 'Uppercase', 'genex-framework' ),
    								'lowercase'  => __( 'Lowercase', 'genex-framework' ),
    								'full-width' => __( 'Full Width', 'genex-framework' ),
    							),
    							'std'     => '', // Todo
    						),
    						array(
    							'id'   => '_gx_flexslider_caption_width',
    							'name' => __( 'Background width', 'genex-framework' ),
    							'type' => 'number',
    							'min'  => 0,
    							'std'  => 0,
    						),
    						array(
    							'id'   => '_gx_flexslider_caption_horizontal_position',
    							'name' => __( 'Background horizontal position', 'genex-framework' ),
    							'type' => 'number',
    							'min'  => 0,
    							'std'  => 0,
    						),
    						array(
    							'id'   => '_gx_flexslider_caption_vertical_position',
    							'name' => __( 'Background vertical position', 'genex-framework' ),
    							'type' => 'number',
    							'min'  => 0,
    							'std'  => 0,
    						),
    					),
    				),
    				array(
    					'id'   => '_gx_flexslider_responsive_caption',
    					'name' => __( 'Responsive Caption Position', 'genex-framework' ),
    					'type' => 'radio',
    					'options' => array(
    						'below'    => __( 'Below Slider', 'genex-framework' ),
    						'infront'   => __( 'Infront of Slider', 'genex-framework' ),
    					),
    					'std' => 'below',
    				),
    
    			),
    		);
    
    		return $meta_boxes;
    
    	}
    
    in reply to: Using oEmbed field and warning message #4912
    VenkatVenkat
    Participant

    I was to use the below code to register the meta box.

    array(
    				'id'      => '_gx_flexslider_caption',
    				'name'    => __( 'Caption', 'genex-framework' ),
    				'type'    => 'wysiwyg', 
    				'options' => array(
    					'media_buttons' => false,
    					'quicktags'     => false,
    					
    				), 
    				'columns' => 12,
    			),

    Kindly letus know if you found the solution.

    in reply to: Using oEmbed field and warning message #4492
    VenkatVenkat
    Participant

    Any updates on this?
    Actually, warning message has been displayed when I use wysiwyg field and leave that field empty (without content), and save, this warning message displays.

    Could you please fix this? Thanks

    in reply to: Fields are hidden with visibility property rather than display #4441
    VenkatVenkat
    Participant
    <?php
    $fields = array(
    	array(
    	'id'      => '_gx_flexslider_type',
    	'name'    => __( 'Type', 'genex-framework' ),
    	'type'    => 'radio',
    	'options' => array(
    		'image' => __( 'Image', 'genex-framework' ),
    		'video' => __( 'Video', 'genex-framework' ),
    		),
    	'std'     => 'image',
    	'columns' => 12,
    ),
    	array(
    		'id'      => '_gx_flexslider_video',
    		'name'    => __( 'Video', 'genex-framework' ),
    		'type'    => 'oembed',
    		'columns' => 12,
    		'hidden'  => array( '_gx_flexslider_type', '!=', 'video' )
    	),
    	array(
    		'id'               => '_gx_flexslider_image',
    		'name'             => __( 'Image', 'genex-framework' ),
    		'type'             => 'image_advanced',
    		'max_file_uploads' => 1,
    		'columns'          => 12,
    		'hidden'           => array( '_gx_flexslider_type', '!=', 'image' )
    	),
    );

    See gap above image.
    Image
    See gap below videoVideo.

    It seems from your message, you are using visibility: hidden; for 12 columns as well. Since its a row, it should use .show() and .hide()

    Thanks for your help

    in reply to: Color Field: Alpha channel possible? #4433
    VenkatVenkat
    Participant

    Hmm. I understand that. Currently I'm using Kirki / Redux Framework for theme options. I would like some of those options page / post_type specific rather than global. I think, at this moment, I've too add another field for opacity. Or may be inherit color field to have transparency, when I'm familiar with metabox code. It would be great to have transparency with color picker. Thanks for your help Anh Tran. ๐Ÿ™‚

    in reply to: Single Image field? #4432
    VenkatVenkat
    Participant

    Works like a charm! Thanks Anh Tran.
    Though I saw it in documentation, I thought it was about how many files can be uploaded at a time. My bad!

    VenkatVenkat
    Participant

    Thanks for the reply Tan.I understand the issue. However, I'm having two radio buttons (image/video), I would like to display appropriate field, depending on selected option. Now that there is gap, it is also bad for UX.

    May be you can add a field attribute to choose between visibility and display properties? or a class? Thank you very much in advance.

    VenkatVenkat
    Participant

    Update to this issue: It seems radio fields has correct functionality. I'm facing issue with Image and OEmbed fields. I mean radio fields has display: none;, but image and oembed has visibility: hidden;

Viewing 8 posts - 1 through 8 (of 8 total)