Pagebuilder - repeater double / repeater in repeater

PHOTO EMBED

Tue Mar 30 2021 11:49:40 GMT+0000 (UTC)

Saved by @Sikor

<?php
'repeater_history' => array(
	'type' => 'repeater',
	'label' => __( 'Taby' , 'engine' ),
	'item_name'  => __( 'Tab', 'engine' ),
	'item_label' => array(
		'selector'     => "[id*='name']",
		'update_event' => 'change',
		'value_method' => 'val'
	),
	'fields' => array(
		'name' => array(
			'type'    => 'text',
			'label'   => __('Nazwa zakładki', 'engine'),
			'default' => '',
		),
		'repeater_inner' => array(
			'type' => 'repeater',
			'label' => __( 'Treści' , 'engine' ),
			'item_name'  => __( 'Tekst', 'engine' ),
			'item_label' => array(
				'selector'     => "[id*='text']",
				'update_event' => 'change',
				'value_method' => 'val'
			),
			'fields' => array(
				'text' => array(
					'type' => 'text',
					'label' => __( 'Tekst', 'engine' ),
				),
			)
		)
	)
),
?>

//tpl.php
      
<?php $repeater_history = $instance['repeater_history']; ?>

<?php if(sizeof((array)$repeater_history) > 0 && !empty($repeater_history)) { ?>
  <?php foreach ((array)$repeater_history as $history => $value) { ?>
      <?php foreach ((array)$value['repeater_inner'] as $inner => $detail) { ?>
          <?php echo $detail['text']; ?>
      <?php } ?>
  <?php } ?>
<?php } ?>
content_copyCOPY