Get attribute admin label on Magento

It may be important to add a class to your Magento shop or category page’s attribute filters. This way, you can control the individual styling of each Magento shop attribute filter via CSS. A great example where this control could be useful is for Color attribute filters. Instead of displaying the colors in a standard list format, you could display them in a color swatch grid. The first step would be to add a unique class to each list item (li). Magento’s default files show you how to get the pretty FrontEnd admin label via getLabel() but how do you get the admin label (ie: the one with underscores)?

The file you would need to update the magento sidebar filter widgets is
Magento Default theme: app/design/frontend/default/default/template/catalog/layer/filter.phtml
or
Your theme: app/design/frontend/your-theme/your-theme-sub-folder/template/catalog/layer/filter.phtml

Replace

 

with

 

This will output as

 

And you’re done! You can control the display of your list items via CSS!