ZF-7212: ulId to be added similar with ulClass
Description
I think we should add an ulId param, not just an ulClass.
In certain situations there is more likely to have the ul identified by ID.
I think we should add an ulId param, not just an ulClass.
In certain situations there is more likely to have the ul identified by ID.
Comments
Posted by Helder Correia (heldercorreia) on 2010-04-01T09:19:39.000+0000
I completely agree with you on this. I need it right now.
Posted by PHP4Dev (php4dev) on 2010-04-03T05:07:05.000+0000
I agree totaly. The class is declared in Zend/View/Helper/Navigation/Menu.php in line 425.
Posted by Maurice Bonemeijer (sugoi) on 2010-07-27T02:40:25.000+0000
I agree as well.
Some situations where an id would be desired: * in many cases it's more efficient to write css selectors based on id * certain js menu's out there rely on id
I would expect setting an id on a navigation container would be part of the most basic features.
Posted by Kai Uwe (kaiuwe) on 2011-01-28T09:51:45.000+0000
The patch should include the following points:
' . self::EOL;_htmlAttribs($attribs) . '>' . self::EOL;Zend_View_Helper_HtmlElement::_htmlAttribs() uses the method "_normalizeId"!
See also ZF-10409
Posted by Sebastian Kors (skors) on 2011-02-25T15:05:12.000+0000
Hi,
it's easy to use your own view helper which adds an id for example.
just create your own view helper class which extends Zend_View_Helper_Navigation_HelperAbstract or Zend_View_Helper_Navigation_Menu and overwrite or replace the mentioned parts.
use your own view helper as follows:
// in your view- or layout script <?php echo $this->navigation()->findHelper('Navigation_MyOwnMenu')->myOwnMenu()->mySetIdMethod('mymenuid')->setUlClass('fancyclass') ; ?>
dont forget to add your library in application.ini for example, so it finds your own view helper.
Posted by Kai Uwe (kaiuwe) on 2011-05-26T10:39:59.000+0000
The patch fixes ZF-7212 and the subtask ZF-10409, because the new function for setting an ID uses the normalization of the ID attribute.
Posted by Rob Allen (rob) on 2012-05-29T20:11:10.000+0000
I can't get patch to apply to trunk.
Posted by Frank Brückner (frosch) on 2012-05-29T20:37:51.000+0000
Hi Rob, I will look into this and create a new patch.
Posted by Frank Brückner (frosch) on 2012-06-01T12:57:15.000+0000
New patch and more unit tests added.
Posted by Adam Lundrigan (adamlundrigan) on 2012-06-06T13:19:03.000+0000
Looks good to me...patches apply cleanly and all Navigation and View_Helper tests pass. As this changes the ID normalization, is there a test in place to ensure that the default normalization result is still the same as it was previously?
Posted by Frank Brückner (frosch) on 2012-06-06T15:14:34.000+0000
Hi Adam, yes: {{testSetPrefixForIdWithNull()}}.
Posted by Rob Allen (rob) on 2012-06-13T19:55:24.000+0000
I can't get patch to apply cleaning. Adam, if you can, feel free to apply it.
Posted by Adam Lundrigan (adamlundrigan) on 2012-06-15T14:29:05.000+0000
Fixed in trunk (1.12.0): r24962