I'm attempting to create a new window when a user clicks a link in the navigation menu. What I'm attempting to do at present is just add a target="_blank" item to the url, thereby creating an entirely new page, and from there I'm planning to learn how to change this for my various other needs. The problem is, I'm unable to get the target to go to the associated link.
I've attempted:
$dropdown->addChild('Text', array('route' =>
'routeName', 'routeParameters' => array('parmName' => 'parameter'),
'attr' => array('target' => '_blank'));
But the above results in it not adding the _blank to anything.
$dropdown->addChild('Text', array('route' => 'routeName',
'routeParameters' => array('paramName' => 'parameter')))
->setAttribute('target', '_blank');
Results in the target being set to the li, not to the link itself, as seen below.
<li target="_blank" class="first"> <a href="routeLink">Text</a>
Is there a means to directly set the attribute to the link, so that it will open in a new window when clicked?
Any time and help you can provide is much appreciated.