Editor controls
Add sections and fields of your own to the sidebar; values are saved with the layout in $config['extra']. Fields can add a class to the grid or set a CSS property, per device.
add_filter( 'vlt_grid_controls', function ( $controls ) {
$controls['card'] = [
'title' => 'Card',
'after' => 'skin',
'condition' => [ 'skin' => 'minimal' ],
'fields' => [
'overlay' => [
'type' => 'toggle',
'label' => 'Overlay',
'default' => true,
'class' => 'has-overlay'
],
'radius' => [
'type' => 'number',
'label' => 'Radius',
'min' => 0,
'max' => 40,
'responsive' => true,
'default' => [
'desktop' => 12,
'tablet' => 8,
'mobile' => 4
],
'style' => [
[
'element' => '.my-card', 'property' => '--card-radius', 'mask' => '$px'
] ] ],
],
];
return $controls;
} );
Field types: toggle, select, number, text, textarea, color, image, separator. Extra fields for Media images: vlt_grid_image_controls.
Was this article helpful?
Thanks for your feedback!