I have an issue and I am stack in this many days now. I am new in PHP so I cannot understand totally concerning variables. Here is my code
<div class="<?php echo $this->class; ?> block filter <?php echo $this->field('schema')->value(); ?> <?php echo $this->field('align')->value(); ?><?php if($this->field('margin_top')->value()): ?> <?php echo $this->field('margin_top')->value(); ?><?php endif; ?><?php if($this->field('margin_bottom')->value()): ?> <?php echo $this->field('margin_bottom')->value(); ?><?php endif; ?><?php if($this->field('margin_top_mobile')->value()): ?> <?php echo $this->field('margin_top_mobile')->value(); ?><?php endif; ?><?php if($this->field('margin_bottom_mobile')->value()): ?> <?php echo $this->field('margin_bottom_mobile')->value(); ?><?php endif; ?>" <?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<div class="ce_portfoliofilter_content">
<?php echo "Aktuelle Projekte in " ?>
<?php foreach($this->group('filter') as $i => $fields): ?>
<a data-filter=".filter_<?php echo standardize($this->field('name#'.$i)->value()); ?>">
<?php if($this->field('icon#'.$i)->value()): ?><i class="<?php echo $this->field('icon#'.$i)->value(); ?>"></i><?php endif; ?>
<span class="name"><?php if($this->field('label_items#'.$i)->value()): ?><?php echo $this->field('label_items#'.$i)->value(); ?><?php else: ?><?php echo $this->field('name#'.$i)->value(); ?><?php endif; ?></span>
</a>
<?php endforeach; ?>
<a data-filter="*" class="all <?php if(\Input::get('filter') == ''): ?>selected<?php endif; ?>"><?php echo $this->field('label')->value(); ?></a>
</div>
<i class="mobile-filter-trigger fa fa-filter"></i>
</div>
<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready(function(){
jQuery('.ce_portfoliofilter .mobile-filter-trigger').click(function(){
jQuery('.ce_portfoliofilter').toggleClass('mobile-filter-show');
});
});
/* ]]> */
</script>
I need the filter-data with the field(name#) to accept more than one values, separated with comma(,) .
Do I have to explode or implode the array? and How I can target to that field ?
$fields
is an array? Show us exactly what it contains. If you want to know "how to explode" on a basic level you can read the manual. If you need more help than that you'll need to ask a clearer question and explain the situation fully.$fields
?var_export($fields);
and paste the results (or a sample of them, if it's too big) into your question.$fields
, but somewhere else? What doesstandardize($this->field('name#'.$i)->value()
return?