start_controls_section( 'service_section', [ 'label' => esc_html__( 'team', 'bappy' ), 'type' => Controls_Manager::SECTION, ] ); $this->add_control( 'image', [ 'label' => __( 'choose photo', 'bappy' ), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [ 'url' => \Elementor\Utils::get_placeholder_image_src(), ], ] ); $this->add_control( 'name', [ 'label' => __( 'name', 'bappy' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => 'Pailsabis Tony', ] ); $this->add_control( 'designation', [ 'label' => __( 'designation', 'bappy' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => 'Company Director', ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'social_icon', [ 'label' => __( 'Social Icon', 'bappy' ), 'type' => \Elementor\Controls_Manager::ICON, 'label_block' => true, 'default' => 'fa fa-facebook', ] ); $repeater->add_control( 'social_url', [ 'label' => __( 'Socia URL', 'bappy' ), 'type' => \Elementor\Controls_Manager::TEXT, 'label_block' => true, ] ); $this->add_control( 'social_media', [ 'label' => __( 'social profile', 'bappy' ), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'title_field' => 'Social Item', 'default' => [ [ 'social_icon' => 'Facbook', 'social_url' => '#' ] ], 'feature' => '{{{ social_media }}}', ] ); $this->end_controls_section(); } protected function render( $instance = [] ) { // get our input from the widget settings. $settings = $this->get_settings_for_display(); //Inline Editing $this->add_inline_editing_attributes( 'image', 'basic' ); $this->add_inline_editing_attributes( 'name', 'basic' ); $this->add_inline_editing_attributes( 'designation', 'basic' ); $this->add_inline_editing_attributes( 'social_icon', 'basic' ); $this->add_inline_editing_attributes( 'social_url', 'basic' ); ?>
get_render_attribute_string( 'name' ); ?>>
get_render_attribute_string( 'designation' ); ?>>
<# view.addInlineEditingAttributes( 'title', 'basic' ); view.addInlineEditingAttributes( 'text', 'basic' ); view.addInlineEditingAttributes( 'designation', 'basic' ); #>
{{{ settings.name}}}
{{{ settings.designation}}}
widgets_manager->register_widget_type( new Widget_Team );