start_controls_section( 'content_section', [ 'label' => __( 'Timeline', 'three-elementor' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'theme_color', [ 'label' => __( 'Timeline Color', 'three-elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_2, ], 'selectors' => [ '{{WRAPPER}} .timeline li .tl-circ' => 'background: {{theme_color}};border:5px solid #e6e6e6 !important', ' .timeline li .timeline-panel:before' => 'border-left:15px solid {{theme_color}};border-right:0px solid {{theme_color}};', ' .timeline li .timeline-panel' => 'border:1px solid {{theme_color}};', ' .timeline::before' => 'background-color:{{theme_color}};', ], ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'list_title', [ 'label' => __( 'Title', 'three-elementor' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'List Title' , 'three-elementor' ), 'label_block' => true, ] ); $repeater->add_control( 'list_content', [ 'label' => __( 'Timelines', 'three-elementor' ), 'type' => \Elementor\Controls_Manager::WYSIWYG, 'default' => __( 'Item content. Click the edit button to change this text.' , 'three-elementor' ), 'show_label' => false, ] ); $repeater->add_control( 'title_color', [ 'label' => __( 'Title Color', 'three-elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_2, ], 'default' => '', ] ); $this->add_control( 'list', [ 'label' => __( 'Timeline List', 'three-elementor' ), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'list_title' => __( 'List Title', 'three-elementor' ), 'list_content' => __( 'Item content. Click the edit button to change this text.', 'three-elementor' ), ], [ 'list_title' => __( 'List Title', 'three-elementor' ), 'list_content' => __( 'Item content. Click the edit button to change this text.', 'three-elementor' ), ], ], 'title_field' => '{{{ list_title }}}', ] ); $this->end_controls_section(); } /** * Render widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); //print_r($settings); $data = $settings['list']; $count=0; echo ''; } } Plugin::instance()->widgets_manager->register_widget_type( new Three_Elementor_Widget_Timeline() );