rbt_section_title(‘gallery’, ‘Section – Title and Content’, ‘Photo’, ‘Portfolio Gallery’, ‘h2’, ”, ‘text-center’, true, ‘no’);
$this->start_controls_section(
‘_section_doob_gallery’,
[
‘label’ => esc_html__( ‘Gallery – Content’, ‘doob’ ),
‘tab’ => Controls_Manager::TAB_CONTENT,
]
);
$repeater = new \Elementor\Repeater();
$repeater->add_control(
‘doob_gallery_images’,
[
‘label’ => esc_html__( ‘Choose Image’, ‘doob’ ),
‘type’ => Controls_Manager::MEDIA,
‘default’ => [
‘url’ => \Elementor\Utils::get_placeholder_image_src(),
],
]
);
$this->add_control(
‘doob_gallery’,
[
‘label’ => esc_html__( ‘Add Gallery Images’, ‘doob’ ),
‘type’ => \Elementor\Controls_Manager::REPEATER,
‘fields’ => $repeater->get_controls(),
‘title_field’ => esc_html__( ‘Gallery Image’, ‘doob’ ),
‘default’ => [
[
‘doob_gallery_images’ => \Elementor\Utils::get_placeholder_image_src(),
],
[
‘doob_gallery_images’ => \Elementor\Utils::get_placeholder_image_src(),
],
[
‘doob_gallery_images’ => \Elementor\Utils::get_placeholder_image_src(),
],
[
‘doob_gallery_images’ => \Elementor\Utils::get_placeholder_image_src(),
],
[
‘doob_gallery_images’ => \Elementor\Utils::get_placeholder_image_src(),
],
[
‘doob_gallery_images’ => \Elementor\Utils::get_placeholder_image_src(),
],
[
‘doob_gallery_images’ => \Elementor\Utils::get_placeholder_image_src(),
],
]
]
);
$this->add_group_control(
Group_Control_Image_Size::get_type(),
[
‘name’ => ‘gallery_thumbnail’,
‘default’ => ‘doob-gallery-thumb’,
‘separator’ => ‘before’,
‘exclude’ => [
‘custom’
]
]
);
$this->end_controls_section();
// Columns Panel
$this->rbt_columns(‘gallery_columns’, ‘Gallery – Columns’, ‘4’, ‘6’, ‘6’, ’12’);
// Style Component
$this->rbt_basic_style_controls(‘section_title_before_title’, ‘Section – Before Title’, ‘.section-title .subtitle .theme-gradient’);
$this->rbt_basic_style_controls(‘section_title_title’, ‘Section – Title’, ‘.section-title .title’);
$this->rbt_basic_style_controls(‘section_title_description’, ‘Section – Description’, ‘.section-title p’);
// Area
$this->rbt_section_style_controls(‘gallery_area’, ‘Section Style’, ‘.rn-gallery-area’);
}
protected function render($instance = [])
{
$settings = $this->get_settings_for_display();
if ( empty( $settings[‘doob_gallery’] ) ) {
return;
}
$id_int = substr( $this->get_id_int(), 0, 3 );
$this->add_render_attribute( ‘rbt-gallery’, ‘class’, ‘rainbow-gallery-area rainbow-section-gap’ );
$this->add_render_attribute( ‘rbt-gallery’, ‘id’, ‘rbt-gallery-‘.esc_attr( $this->get_id() ));
?>
widgets_manager->register(new Doob_Elementor_Widget_Gallery());