• Resolved Elango

    (@steelthemeshelp)


    Hi ,

    Is it possible to create nested repeater in elementor free version.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support priyak1996

    (@priyak1996)

    Hello,

    Can you please elaborate what do you mean by nested repeater?

    Do you have any reference example so that I can check?

    Thread Starter Elango

    (@steelthemeshelp)

    class Nested_Repeater_Widget extends \Elementor\Widget_Base {

    ? ? public function get_name() {
    ? ? ? ? return 'nested_repeater';
    ? ? }

    ? ? public function get_title() {
    ? ? ? ? return __('Nested Repeater', 'text-domain');
    ? ? }

    ? ? public function get_icon() {
    ? ? ? ? return 'eicon-post-list';
    ? ? }

    ? ? public function get_categories() {
    ? ? ? ? return ['general'];
    ? ? }

    ? ? protected function _register_controls() {

    ? ? ? ? $repeater_inner = new \Elementor\Repeater();

    ? ? ? ? // Define the fields for the inner repeater
    ? ? ? ? $repeater_inner->add_control(
    ? ? ? ? ? ? 'inner_title',
    ? ? ? ? ? ? [
    ? ? ? ? ? ? ? ? 'label' => __('Inner Title', 'text-domain'),
    ? ? ? ? ? ? ? ? 'type' => \Elementor\Controls_Manager::TEXT,
    ? ? ? ? ? ? ? ? 'default' => __('Inner Title', 'text-domain'),
    ? ? ? ? ? ? ]
    ? ? ? ? );

    ? ? ? ? $repeater_inner->add_control(
    ? ? ? ? ? ? 'inner_description',
    ? ? ? ? ? ? [
    ? ? ? ? ? ? ? ? 'label' => __('Inner Description', 'text-domain'),
    ? ? ? ? ? ? ? ? 'type' => \Elementor\Controls_Manager::TEXTAREA,
    ? ? ? ? ? ? ? ? 'default' => __('Inner Description', 'text-domain'),
    ? ? ? ? ? ? ]
    ? ? ? ? );

    ? ? ? ? $repeater = new \Elementor\Repeater();

    ? ? ? ? // Define the fields for the outer repeater
    ? ? ? ? $repeater->add_control(
    ? ? ? ? ? ? 'outer_title',
    ? ? ? ? ? ? [
    ? ? ? ? ? ? ? ? 'label' => __('Outer Title', 'text-domain'),
    ? ? ? ? ? ? ? ? 'type' => \Elementor\Controls_Manager::TEXT,
    ? ? ? ? ? ? ? ? 'default' => __('Outer Title', 'text-domain'),
    ? ? ? ? ? ? ]
    ? ? ? ? );

    ? ? ? ? $repeater->add_control(
    ? ? ? ? ? ? 'outer_description',
    ? ? ? ? ? ? [
    ? ? ? ? ? ? ? ? 'label' => __('Outer Description', 'text-domain'),
    ? ? ? ? ? ? ? ? 'type' => \Elementor\Controls_Manager::TEXTAREA,
    ? ? ? ? ? ? ? ? 'default' => __('Outer Description', 'text-domain'),
    ? ? ? ? ? ? ]
    ? ? ? ? );

    ? ? ? ? // Add the inner repeater as a field in the outer repeater
    ? ? ? ? $repeater->add_control(
    ? ? ? ? ? ? 'inner_list',
    ? ? ? ? ? ? [
    ? ? ? ? ? ? ? ? 'label' => __('Inner List', 'text-domain'),
    ? ? ? ? ? ? ? ? 'type' => \Elementor\Controls_Manager::REPEATER,
    ? ? ? ? ? ? ? ? 'fields' => $repeater_inner->get_controls(),
    ? ? ? ? ? ? ? ? 'default' => [],
    ? ? ? ? ? ? ? ? 'title_field' => '
    inner_title',
    ? ? ? ? ? ? ]
    ? ? ? ? );

    ? ? ? ? // Add the outer repeater control to the widget
    ? ? ? ? $this->add_control(
    ? ? ? ? ? ? 'outer_list',
    ? ? ? ? ? ? [
    ? ? ? ? ? ? ? ? 'label' => __('Outer List', 'text-domain'),
    ? ? ? ? ? ? ? ? 'type' => \Elementor\Controls_Manager::REPEATER,
    ? ? ? ? ? ? ? ? 'fields' => $repeater->get_controls(),
    ? ? ? ? ? ? ? ? 'default' => [],
    ? ? ? ? ? ? ? ? 'title_field' => 'outer_title',
    ? ? ? ? ? ? ]
    ? ? ? ? );
    ? ? }

    ? ? protected function render() {
    ? ? ? ? $settings = $this->get_settings_for_display();

    ? ? ? ? if (!empty($settings['outer_list'])) {
    ? ? ? ? ? ? echo '<div class="outer-list">';
    ? ? ? ? ? ? foreach ($settings['outer_list'] as $outer_item) {
    ? ? ? ? ? ? ? ? echo '<div class="outer-item">';
    ? ? ? ? ? ? ? ? echo '<h3>' . esc_html($outer_item['outer_title']) . '</h3>';
    ? ? ? ? ? ? ? ? echo '<p>' . esc_html($outer_item['outer_description']) . '</p>';

    ? ? ? ? ? ? ? ? if (!empty($outer_item['inner_list'])) {
    ? ? ? ? ? ? ? ? ? ? echo '<div class="inner-list">';
    ? ? ? ? ? ? ? ? ? ? foreach ($outer_item['inner_list'] as $inner_item) {
    ? ? ? ? ? ? ? ? ? ? ? ? echo '<div class="inner-item">';
    ? ? ? ? ? ? ? ? ? ? ? ? echo '<h4>' . esc_html($inner_item['inner_title']) . '</h4>';
    ? ? ? ? ? ? ? ? ? ? ? ? echo '<p>' . esc_html($inner_item['inner_description']) . '</p>';
    ? ? ? ? ? ? ? ? ? ? ? ? echo '</div>';
    ? ? ? ? ? ? ? ? ? ? }
    ? ? ? ? ? ? ? ? ? ? echo '</div>';
    ? ? ? ? ? ? ? ? }

    ? ? ? ? ? ? ? ? echo '</div>';
    ? ? ? ? ? ? }
    ? ? ? ? ? ? echo '</div>';
    ? ? ? ? }
    ? ? }
    }

    // Register the widget
    \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new \Nested_Repeater_Widget());

    if i use repeater inside repeater having issue.


    Any how to eable all the responsive breakpoints why installing the elemntor pluign any code to enable ?


    Thanks
    Plugin Support enmanueldiaz

    (@enmanueldiaz)

    My name is Enmanuel and I am the agent that will be helping you today.

    I see what you are having an issue with regarding the possibility of creating nested repeaters in the free version of Elementor.

    Currently, the free version of Elementor does not support nested repeaters. Repeaters are an advanced feature typically found in the Elementor Pro version, allowing for more complex data structures and layouts.

    If you require the functionality of nested repeaters, you might consider upgrading to Elementor Pro. Alternatively, you can explore third-party plugins or custom coding to achieve a similar effect, though this may require more technical expertise.

    If you have any further questions or need additional assistance, please feel free to reach out. I’m here to help!

    Thread Starter Elango

    (@steelthemeshelp)

    hi

    thank you.

    one more thing how to enable all the responsive breakpoint automatically when installing my theme.

    thanks again

    • This reply was modified 4 months, 1 week ago by Elango.
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.