Agregue una clase a UL de listas links.phtml en Magento

I want to be able to add a class to the UL element of lists that are output using the block type="page/template_links" that uses the template page/template/links.phtml (eg: top links, footer links).

Is there a way to add a class via the XML? An attribute on <block />?

preguntado el 31 de julio de 12 a las 13:07

1 Respuestas

This is possible by making a slight modification to page/template/links.phtml and subsequently creating a small piece of layout xml for each links block you wish to add a class to.

First, if you haven't already done so, copy over page/template/links.phtml to you theme and add the following inside the class attribute of the ul tag:

<?php echo $this->getClass() ?>

Then, taking the footer links block as an example, the layout snippet would look like this (obviously replacing 'test-class' with the class you wish to apply to the ul):

<reference name="footer_links">
    <action method="setClass"><class>test-class</class></action>

Respondido 31 Jul 12, 14:07

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.