I have foreach
which brings me all the children of an X attribute, and I need to add a specific class in the <ul>
list to be able to format by CSS according to the Y attribute. However, I can not add the attribute name in the class.
Below is an example taken from app / design / frontend / base / default / tempplate / catalog / layer / filter.phtml
<ol class="filters filter-type">
<?php foreach ($this->getItems() as $_item): ?>
<li>
<?php if ($_item->getCount() > 0): ?>
<a href="<?php echo $this->urlEscape($_item->getUrl()) ?>"><?php echo $_item->getLabel() ?></a>
<?php else: echo $_item->getLabel() ?>
<?php endif; ?>
<?php if ($this->shouldDisplayProductCount()): ?>
(<?php echo $_item->getCount() ?>)
<?php endif; ?>
</li>
<?php endforeach ?>
</ol>
On a category-filtered page, I want the attributes of the products to load those blocks to have a specific class to identify.
Example:
Size
- 38
- 39
- 40
Sex
- Male
- Female
Price
- 30 to 40
- 50 to 80
- 100 to 200
Where each block receives a class: filter-size , filter-sex , filter- only I do not know what attribute it will bring and I need it to be dynamic.