I'm not sure if you can add custom attributes to the navigation, but why not
use external Javascript for this instead of inline? In jQuery it would be
simple:
jQuery(function($)
{
$('ul.navigation a[href="#"]').click(function(event)
{
event.preventDefault();
});
});
--
Hector
On Fri, Mar 19, 2010 at 1:32 AM, Rocco Bruyn <[email protected]> wrote:
> Hi all,
>
>
>
> I’m working on a project which (surprisingly) has pages and a navigation
> menu.
>
> The ‘elbows’ in the menu are not clickable. They just expand the underlying
> sub-pages.
>
> This works fine by creating a Zend_Navigation_Page_Uri with an uri ‘#’.
>
> But the browser still responds to the click which I want to prevent by
> adding an attribute onclick=”return false”.
>
> I can’t seem to figure out how to do this. Most simple case would be:
>
>
>
> $nav = new Zend_Navigation(array(
>
> array(
>
> 'label' => 'Folder',
>
> 'uri' => '#',
>
> 'onclick' => 'return false'
>
> )
>
> ));
>
>
>
> $helper = new Zend_View_Helper_Navigation_Menu();
>
> $helper->setView(new Zend_View());
>
>
>
> echo $helper->render($nav);
>
>
>
> But doesn’t work as expected.
>
> Can anyone shed a light on this?
>
>
>
> Regards,
>
> Rocco
>
>
>
>
>
>
>