I'm using Lightbox as a modal box solution and have been having an issue trying to get modal windows for the default Login and Registration links. I'm trying to access from inside a module that I"m currently using to make all the changes. I've tried several other "Box" solutions and Lightbox seems to be what I'm looking for, but I cannot figure out the hook to add rel='lightbox' to login and reg. Could someone point out what it is for me?

EDIT I tried using this in my base theme, which will give me a modal on both reg and login, but shows an empty form?

function spti_base_preprocess_page(&$variables) {

/* .....stuff..... */

    // add the system user-menu into the page as its own thing
    $variables['platform_user_menu'] = menu_navigation_links('menu-platform-user-menu');

    foreach($variables['platform_user_menu'] as &$hijackLinks) { $hijackLinks['attributes']['rel'] = 'lightframe'; }

    $variables['page']['platform_user_menu'] = array(
      '#theme' => 'links__system_user_menu',
      '#links' =>   $variables['platform_user_menu'],
      '#attributes' => array(
        'id' => 'platform-user-menu',
        'class' => array('links', 'inline', 'clearfix'),

/* .....stuff..... */


1 Answer 1


Yes you could spend time tearing apart templates, and hacking in the required code, I would say the cleaner, 'more drupal' solution would be to use a combination of

From the project page:

This simple module allows you to specify some additional attributes for menu items such as id, name, class, style, and rel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.