start_controls_section( 'section_tab', [ 'label' => esc_html__('Title settings', 'cafesio'), ] ); $this->add_control( 'title', [ 'label' => esc_html__( 'Heading text', 'cafesio' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => esc_html__( 'Heading text', 'cafesio' ), 'default' => esc_html__( ' Life Style ', 'cafesio' ), ] ); $this->add_control( 'heading_type', [ 'label' => __( 'Heading type', 'cafesio' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'h2', 'options' => [ 'h1' => __( 'H1', 'cafesio' ), 'h2' => __( 'H2', 'cafesio' ), 'h3' => __( 'H3', 'cafesio' ), 'h4' => __( 'H4', 'cafesio' ), 'h5' => __( 'H5', 'cafesio' ), 'h6' => __( 'H6', 'cafesio' ), 'p' => __( 'P', 'cafesio' ), ], ] ); $this->add_responsive_control( 'title_align', [ 'label' => esc_html__( 'Alignment', 'cafesio' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'cafesio' ), 'icon' => 'fa fa-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'cafesio' ), 'icon' => 'fa fa-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'cafesio' ), 'icon' => 'fa fa-align-right', ], 'justify' => [ 'title' => esc_html__( 'Justified', 'cafesio' ), 'icon' => 'fa fa-align-justify', ], ], 'default' => 'left', 'selectors' => [ '{{WRAPPER}} .section-heading .block-title' => 'text-align: {{VALUE}};', ], ] );//Responsive control end $this->add_control( 'show_title_left_border', [ 'label' => __( 'Show Title Left Border', 'cafesio' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'cafesio' ), 'label_off' => __( 'Hide', 'cafesio' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->end_controls_section(); //Title Style Section $this->start_controls_section( 'section_title_style', [ 'label' => esc_html__( 'Title', 'cafesio' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_bg_color', [ 'label' => esc_html__( 'Title Background', 'cafesio' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .block-title > span.title-bg, {{WRAPPER}} .block-title > span.title-bg:before ' => 'background-color: {{VALUE}};', '{{WRAPPER}} .block-title > span.title-bg:after' => 'border-left-color: {{VALUE}};', ], ] ); $this->add_control( 'title_border_color', [ 'label' => esc_html__( 'Title border style color', 'cafesio' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .block-title.title-border' => 'border-bottom: 2px solid {{VALUE}};', '{{WRAPPER}} .heading-style2 .block-title.title-border:before' => 'background-color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'title_border_height', [ 'label' =>esc_html__( 'Border Height', 'cafesio' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 10, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'desktop_default' => [ 'size' => 2, 'unit' => 'px', ], 'tablet_default' => [ 'size' => 2, 'unit' => 'px', ], 'mobile_default' => [ 'size' => 2, 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .heading-style2 .block-title.title-border:before' => 'height: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .block-title.title-border' => 'border-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Title color', 'cafesio' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .section-heading .block-title' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'label' => esc_html__( 'Main title', 'cafesio' ), 'scheme' => Scheme_Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .section-heading .block-title', ] ); $this->add_responsive_control( 'title_padding', [ 'label' => __( 'Title Text Padding', 'cafesio' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px','%'], 'selectors' => [ '{{WRAPPER}} .block-title.title-border .title-bg' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'title_margin', [ 'label' => __( 'Title Margin', 'cafesio' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px','%'], 'selectors' => [ '{{WRAPPER}} .block-title.title-border' => 'Margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'title_angle_shap', [ 'label' => esc_html__( 'Title Shap', 'cafesio' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'show_title_shap', [ 'label' => __( 'Show Title shap', 'cafesio' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'cafesio' ), 'label_off' => __( 'Hide', 'cafesio' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_responsive_control( 'border_title_shap', [ 'label' => __( 'Border', 'cafesio' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px'], 'allowed_dimensions' => ['top', 'left'], 'selectors' => [ '{{WRAPPER}} .block-title.title-border .title-bg:after' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'border_title_shap_position', [ 'label' => __( 'Angle Shap Position', 'cafesio' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => -100, 'max' => 200, ], ], 'default' => [ 'unit' => 'px', 'size' => -15, ], 'selectors' => [ '{{WRAPPER}} .block-title.title-border .title-bg:after' => 'right: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); } //Register control end protected function render( ) { $settings = $this->get_settings(); $title = $settings['title']; $show_title_shap = $settings['show_title_shap']; $heading_type = $settings['heading_type']; $show_title_left_border = $settings['show_title_left_border']; $title_1 = str_replace(['{', '}'], ['', ''], $title); ?>