Hey und zwar bin ich aktuell dabei ein neues Plugin für Elementor zu entwickeln. Mein Problem liegt nun darin das ich eine foreach Schleife in mehrere columns unterteilen möchte.
protected function render() {
$settings = $this->get_settings_for_display();
$fallback_defaults = [
'fa fa-check',
'fa fa-times',
'fa fa-dot-circle-o',
];
$this->add_render_attribute( 'icon_list', 'class', 'elementor-icon-list-items' );
$this->add_render_attribute( 'list_item', 'class', 'elementor-icon-list-item' );
if ( 'inline' === $settings['view'] ) {
$this->add_render_attribute( 'icon_list', 'class', 'elementor-inline-items' );
$this->add_render_attribute( 'list_item', 'class', 'elementor-inline-item' );
}
?>
<ul <?php $this->print_render_attribute_string( 'icon_list' ); ?>>
<?php
foreach ( $settings['icon_list'] as $index => $item ) :
echo '<div class="second-wrapper">';
$repeater_setting_key = $this->get_repeater_setting_key( 'text', 'icon_list', $index );
echo '<div class="inner-wrapper">';
$this->add_render_attribute( $repeater_setting_key, 'class', 'elementor-icon-list-text' );
$this->add_inline_editing_attributes( $repeater_setting_key );
$migration_allowed = \Elementor\Icons_Manager::is_migration_allowed();
?>
<span <?php $this->print_render_attribute_string( 'list_item' ); ?>>
<?php
if ( ! empty( $item['link']['url'] ) ) {
$link_key = 'link_' . $index;
$this->add_link_attributes( $link_key, $item['link'] );
?>
<a <?php $this->print_render_attribute_string( $link_key ); ?>>
<?php
}
// add old default
if ( ! isset( $item['icon'] ) && ! $migration_allowed ) {
$item['icon'] = isset( $fallback_defaults[ $index ] ) ? $fallback_defaults[ $index ] : 'fa fa-check';
}
$migrated = isset( $item['__fa4_migrated']['selected_icon'] );
$is_new = ! isset( $item['icon'] ) && $migration_allowed;
if ( ! empty( $item['icon'] ) || ( ! empty( $item['selected_icon']['value'] ) && $is_new ) ) :
?>
<span class="elementor-icon-list-icon">
<?php
if ( $is_new || $migrated ) {
\Elementor\Icons_Manager::render_icon( $item['selected_icon'], [ 'aria-hidden' => 'true' ] );
} else { ?>
<i class="<?php echo esc_attr( $item['icon'] ); ?>" aria-hidden="true"></i>
<?php } ?>
</span>
<?php endif; ?>
<span <?php $this->print_render_attribute_string( $repeater_setting_key ); ?>><?php $this->print_unescaped_setting( 'text', 'icon_list', $index ); ?></span>
<?php if ( ! empty( $item['link']['url'] ) ) : ?>
</a>
<?php endif; ?>
</span>
</div>
</div>
<?php
endforeach;
?>
</ul>
hätte hier jemand eventuell eine Idee wie ich zum beispiel 2 der spans in einen div packen kann dann wieder 3 in einen und so weiter ?