I want to force admin pages open only and only in overlay. As you know if a link with an admin path is clicked it opens in overlay (if enabled). But if you write the URL to the browser, or use some deep link, or you are already in administration theme, the links expectedly wouldn't open in overlay.

How could I force the pages, even if the URL is entered to the browser's path, to open in overlay.

For example, if I type in the browser:


It should always open as:



You can use the context overlay module to achieve this, this way you can easily configure what pages should be opened in an overlay.

You'll need to install:

  • Thanks for the try, but I didn't ask how to configure pages to open in overlay. I already do that using hook_admin_paths(). I don't need to install 2 modules for such simple task. My question is, how to FORCE those paths to open ALWAYS in overlay. – Елин Й. Feb 23 '16 at 9:24

I really do not recommend doing this.

However, you can use a custom rewrite rule. You will have to create this in your .htaccess file yourself.

Rewrite anything with /admin/ to use the overlay.

  • It is not only admin paths, but I also set several other paths to be opened in overlay using hook_admin_paths(). I would actually prefer a way without editing the .htaccess file, preferably using some Drupal API functions so that it consistently opens all administrative paths in overlay. Another point is that the productive server is IIS. – Елин Й. Feb 13 '14 at 19:05
  • perhaps I am tired today, but I really don't think that is possible. in theory, I think you could do a regex every time a page loads, and if /admin/ without #overlay, redirect the user. – jdu Feb 13 '14 at 19:15
  • Oh I'm sorry, did you take a look at the ThemeKey module (drupal.org/project/overlay_paths), they have an API for this. I would check out how they accomplish this. An other option is rewriting those urls in your .htaccess file to make sure the use of overlays is forced – Fons Vandamme Feb 23 '16 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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