Is it possible to add a lightbox to a regular drupal navigation menu? There are some pages that I think would belong best in a lightbox, but couldn't find a way to add rel to the menu link. Any help is appreciated, thanks. I apologize if this is a duplicate, I searched and did not find another issue.

Comments

stella’s picture

Not that I know of. The correct way of doing this might be to request a feature to the core menu module, so that the ability to define additional link attributes (on a per menu item basis) is added to the menu UI (on add/edit menu item form).

It's not something that lightbox2 should do imho.

Cheers,
Stella

Flying Drupalist’s picture

Status: Active » Closed (fixed)

Thanks, I'll do that.

gforce301’s picture

Sure you can. Implement this function theme_menu_item_link(). Docs found here for D6.x http://api.drupal.org/api/function/theme_menu_item_link/6

You can make a menu link look anyway you want. Not really a Lightbox2 issue more of a theme issue.

stella’s picture

Yes, that is possible, but we want a way so the user can selectively pick which links it's applied to. The best implementation of this would to do via the menu UI. I can see other uses for this functionality too, e.g. other onclick events, class names, etc.

Though, yes, you could do this in the theme layer which is a pretty good solution for now.

Cheers,
Stella

gforce301’s picture

I guess I do not follow your definition of "user". If the user is capable of writing javascript that could be used by an onclick event, or the necessary css to use additional classes on a menu item, then why would they not be able to use the very simple theme function?

You can ask the core team to add whatever you would like, but it seems like what you are asking for should be provided in an additional module. The specific case that started this is at best something that less than 1% of all people would need to do? That pretty much makes it a specific theme issue for 1 site. Core provides the link and a theme function to change it, really thats all the core should provide.

stella’s picture

Fair enough, either way I think we're agreed that it shouldn't be done by the Lightbox2 module.

Cheers,
Stella

rcorveira’s picture

Hello, i need some help with this, please.

I need to use lightbox in menu item in my intranet. I need a "external" link to other internal webpage with autoindex site(http://autoindex.sourceforge.net/), where i store the templates of my company.

Best regards
Rui Corveira

aschiwi’s picture

You guys are probably looking for this module: http://drupal.org/project/menu_attributes

truyenle’s picture

#8 works for me. Thanks

clemmanson’s picture

Issue summary: View changes

#8 Perfect, just you need to install menu_attributes and lightbox module, after that you edit your own menu link, you need to add exactly lightbox in "rel" field and it's done.