By chris.mccreery on
Hi I am trying to add rel="lightframe" to a specific menu item on my drupal site so that this external link opens within a lightbox frame. I'm by no means a php developer but this is what I have so far in my template.php file in my theme directory(fusion)
function fusion_menu_item_link($link) {
if (! is_array($link['localized_options'])) {
$link['localized_options'] = array();
}
if (! is_array($link['localized_options']['attributes'])) {
$link['localized_options']['attributes'] = array();
}
if ($link['href'] == 'http://web.rgdirect.com/fusionmap/') {
$link['localized_options']['attributes']['rel'] = 'lightframe';
}
return l($link['title'], $link['href'], $link['localized_options']);
}
Does anyone know what I'm missing? I honestly don't have any idea.
Thanks,
Comments
Forgot to mention that I am
Forgot to mention that I am just trying to test for the one specific link item which I assumed the following was testing for:
Thanks again,
I believe that you can add
I believe that you can add the "rel" attribute to specific items in drupal menus using the http://drupal.org/project/menu_attributes module.
This does not answer your coding question, but it works and its easy.
Awesome
Thank you so much, I just wasn't searching properly for modules I guess. Way easier. Thank you very much.
You are welcome.
You are welcome.