Handling of Pop-up Windows by SimpleMenu

Feature

By default, SimpleMenu is not shown on pop-up windows. There is a flag in the SimpleMenu settings that can be unchecked to avoid this side effect. The pop-up capability is often detected when you open a new tab from the current window. It will depend on the browser and the link being clicked1.

Quick Fix

When the menu is only used by the administrators, it is possible to simply open a new tab and copy and paste the URL from the existing window with the missing menu to the new tab and hit enter. The menu will then appear in new tab and you can close the old tab where the menu is missing.

This works in all cases, but is really workable only for administrators. It can also be annoying after a while to have to transfer from one tab to another.

Pop-up Window SimpleMenu Settings

The SimpleMenu pop-up and pages settings.If you do not use any pop-up window, you can go to the global settings and turn off the Detect pop-up windows checkbox.

Turning off the Detect pop-up windows checkbox bypasses the JavaScript test. This means that whether you are in a pop-up or not, the menu will be inserted in the window.

In most cases, this will not be a problem on a Drupal site.

There are two known places that will get the menu when they should not:

  • The IMCE pop-up window2,
  • The pop-up API using IFRAME to display other windows within a page.

Pop-ups and Pages

If the JavaScript code is really a problem, you will need to turn off the Detect pop-up windows checkbox. This means you will see the menu in pop-up windows.

To paliate to this problem, you may add the path to pop-up windows in the Pages text area and select the Show on every page except the listed pages.

Often, you cannot see the path to a pop-up. The right mouse button should give you the option to open the Properties where you will find the path.

Pop-ups and Themes

It is also possible to hide the SimpleMenu based on which theme is being used to display a page. If you can use a different theme for your pop-up windows, then you could also forbid the use of SimpleMenu with that theme.

Pop-ups and attachment

The wrapper div tag in Garland.You may change the default attachment of the SimpleMenu bar. By default SimpleMenu is attached (prepend) to the body tag. Instead, you can enter the identifier of an object such as #wrapper. You may also enter the name of a class. In tha case, the SimpleMenu bar is attached to the first element marked with that class.

This works whenever your pop-up windows do not use the default page.tpl.php and thus do not include a #wrapper element. When the same page template is used for pop-ups, this method does not work.

  • 1. We are trying to ameliorate the code, but it is not easy to make it work properly 100% of the time.
  • 2. You can find the IMCE module on Drupal.org.