4

Is there a way to disable the Drupal 7 overlay for some administrative links by not others?

For usability reasons the site I'm working on would benefit from some administrative links using the default overlay behavior while 1 or 2 would benefit from having it disabled. Since the vast majority of the links make more sense for users to experience in the overlay I'd like it to be generally enabled for them, but be able to keep a couple specific links embargoed so the JavaScript does not update their behavior.

5

Hope this will help you.

In Drupal 7 you can achive this by using hook_admin_paths_alter

Programatically

  • hook_admin_paths_alter : Redefine administrative paths defined by other modules.

    function HOOK_admin_paths_alter(&$paths) {
      //return FALSE to the path where you don't want to show in OVERLAY
      $paths['node/*/edit'] = FALSE;
      $paths['node/add'] = FALSE;
      $paths['node/add/*'] = FALSE;
    }
  

Using Module

  • Overlay Paths : You can enable the overlay for selected non-admin paths and also you can disable overlay for selected admin paths.
5

inizio's answer is very helpful, I found one other solution (which is the one that made sense in my context in the end).

Add a class of overlay-exclude to the anchor tag:

<a class="overlay-exclude" href="/node/add/page">Create New Page</a>
1
  • For anyone who doesn't know (learning D8 before D7, I didn't), you can turn off the administrative overlay completely per user, from /user/[uid]/edit (scroll down), and there's also a per role permission ("Access the administrative overlay") – William Turrell Apr 9 '19 at 13:24
0

HOOK_admin_paths_alter() is a very good idea, but it seems that for the specified paths it will use the front theme, not the administrative one. The overlay_paths module remained the second choice which seems to work fine.

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.