ded to grid. Other items appear according to query settings.', 'elementor-pro' ), 'content_classes' => 'elementor-descriptor', 'condition' => [ 'static_position!' => '', 'template_id!' => '', ], ] ); $this->add_control( 'alternate_templates', [ 'label' => esc_html__( 'Templates', 'elementor-pro' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'title_field' => 'Alternate Template', 'condition' => [ 'alternate_template' => 'yes', 'posts_per_page!' => 1, 'template_id!' => '', ], 'default' => [ [ 'template_id' => null, ], ], ] ); // Location for the Edit handle. $this->add_control( 'edit_handle_selector', [ 'label' => esc_html__( 'Edit Handle Selector', 'elementor-pro' ), 'type' => Controls_Manager::HIDDEN, 'default' => '[data-elementor-type="loop-item"]', 'render_type' => 'none', 'frontend_available' => true, ] ); $this->end_injection(); } protected function register_additional_options_section_controls() { $this->start_controls_section( 'section_additional_options', [ 'label' => esc_html__( 'Additional Options', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_CONTENT, 'condition' => [ 'template_id!' => '', ], ] ); $this->add_control( 'enable_nothing_found_message', [ 'label' => esc_html__( 'Nothing Found Message', 'elementor-pro' ), 'description' => esc_html__( 'Note: This message will appear when no content is loaded in the grid.', 'elementor-pro' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => esc_html__( 'Off', 'elementor-pro' ), 'label_on' => esc_html__( 'On', 'elementor-pro' ), ] ); $this->add_control( 'nothing_found_message_text', [ 'type' => Controls_Manager::TEXTAREA, 'ai' => [ 'type' => 'text', ], 'dynamic' => [ 'active' => true, ], 'condition' => [ 'enable_nothing_found_message' => 'yes', ], 'default' => esc_html__( 'It seems we can’t find what you’re looking for.', 'elementor-pro' ), ] ); $this->add_responsive_control( 'nothing_found_message_align', [ 'label' => esc_html__( 'Alignment', 'elementor-pro' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'start' => [ 'title' => esc_html__( 'Start', 'elementor-pro' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'elementor-pro' ), 'icon' => 'eicon-text-align-center', ], 'end' => [ 'title' => esc_html__( 'End', 'elementor-pro' ), 'icon' => 'eicon-text-align-right', ], ], 'selectors' => [ '{{WRAPPER}}' => '--e-loop-nothing-found-message-align: {{VALUE}};', ], 'condition' => [ 'enable_nothing_found_message' => 'yes', ], 'render_type' => 'ui', ] ); $this->add_control( 'nothing_found_message_html_tag', [ 'label' => esc_html__( 'HTML Tag', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'span' => 'span', ], 'default' => 'div', 'condition' => [ 'enable_nothing_found_message' => 'yes', ], ] ); $this->end_controls_section(); } protected function register_design_layout_controls() { $this->start_controls_section( 'section_design_layout', [ 'label' => esc_html__( 'Layout', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'column_gap', [ 'label' => esc_html__( 'Gap between columns', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'max' => 100, ], 'em' => [ 'max' => 10, ], 'rem' => [ 'max' => 10, ], ], 'selectors' => [ '{{WRAPPER}}' => '--grid-column-gap: {{SIZE}}{{UNIT}}', ], ] ); $this->add_responsive_control( 'row_gap', [ 'label' => esc_html__( 'Gap between rows', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'max' => 100, ], 'em' => [ 'max' => 10, ], 'rem' => [ 'max' => 10, ], ], 'frontend_available' => true, 'selectors' => [ '{{WRAPPER}}' => '--grid-row-gap: {{SIZE}}{{UNIT}}', ], ] ); $this->end_controls_section(); } protected function register_design_nothing_found_message_controls() { $this->start_controls_section( 'section_nothing_found_message_design', [ 'label' => esc_html__( 'Nothing Found Message', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'template_id!' => '', 'enable_nothing_found_message' => 'yes', ], ] ); $this->add_responsive_control( 'nothing_found_message_space_from_top', [ 'label' => esc_html__( 'Space from top', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'max' => 200, ], 'em' => [ 'max' => 20, ], 'rem' => [ 'max' => 20, ], ], 'selectors' => [ '{{WRAPPER}}' => '--e-loop-nothing-found-message-space-from-top: {{SIZE}}{{UNIT}}', ], ] ); $this->add_responsive_control( 'nothing_found_message_space_from_bottom', [ 'label' => esc_html__( 'Space from bottom', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'max' => 200, ], 'em' => [ 'max' => 20, ], 'rem' => [ 'max' => 20, ], ], 'selectors' => [ '{{WRAPPER}}' => '--e-loop-nothing-found-message-space-from-bottom: {{SIZE}}{{UNIT}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'nothing_found_message_typography', 'selector' => '{{WRAPPER}} .e-loop-nothing-found-message__text', 'separator' => 'before', ] ); $this->add_control( 'nothing_found_message_color', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}}' => '--e-loop-nothing-found-message-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'nothing_found_message_text_shadow', 'selector' => '{{WRAPPER}} .e-loop-nothing-found-message__text', ] ); $this->add_group_control( Group_Control_Text_Stroke::get_type(), [ 'name' => 'nothing_found_message_text_stroke', 'selector' => '{{WRAPPER}} .e-loop-nothing-found-message__text', ] ); $this->end_controls_section(); } public static function on_import_update_dynamic_content( array $element_config, array $data, $controls = null ) : array { if ( isset( $element_config['settings']['template_id'] ) && isset( $data['post_ids'] ) ) { $element_config['settings']['template_id'] = $data['post_ids'][ $element_config['settings']['template_id'] ] ?? 0; } return $element_config; } }