Closed (fixed)
Project:
Drupal core
Version:
7.0-alpha5
Component:
overlay.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
8 Jun 2010 at 13:27 UTC
Updated:
3 Jan 2014 at 01:42 UTC
Jump to comment: Most recent
Dear Drupalers,
I tried to implement the overlay on additional non-administrative pages with
the hook_admin_paths_alter().
But the following code lets the overlay close immediately on the path "custom".
function myModule_admin_paths_alter(&$paths) {
// Treat all user pages as administrative.
$paths['custom'] = TRUE;
$paths['custom/*'] = TRUE;
}
Is there any chance to enable the overlay on custom ("administrative") paths?
Kind regards and keep on rocking!
Matthias
Comments
Comment #1
Smudio commentedComment #2
casey commentedIt should work. Did you clear Drupal cache?
Comment #3
casey commentedoops
Comment #4
Smudio commentedThanks for the response, casey,
I cleared the caches, does not work unfortunately...
Comment #5
David_Rothstein commentedCode similar to the above does work fine for me. Maybe you can post a larger section of your code?
Note that it is only expected to open in the overlay if you click on a link to it in the site or visit it by URL with something like http://example.com/#overlay=custom. If you go to http://example.com/custom directly, it won't open in the overlay (by design, although I think that is problematic in some ways). It sounds like that is probably not your issue, but thought I'd mention it in case it is.
Comment #6
Smudio commentedHi David,
could you post your sample code since I tried to implement hook_admin_paths() and hook_admin_paths_alter() in a variety of ways... ?
I had created menu items, but the overlay opens and closes immediately on the specified paths.
Do I miss anything when writing a custom module which only contains the code above in a .module file and an .info file?
Thanks,
Matthias
Comment #7
David_Rothstein commentedIn sites/all/modules/mymodule, if I put mymodule.info with:
and mymodule.module with
it all seems to work fine - clicking on the new 'Custom' link in the navigation menu, as well as any user-related links, takes me into the overlay when I am logged in as an administrator.
Is it possible you forgot to define the page callback for your menu item? If I remove the mymodule_custom_page() function above, I get some weird behavior similar to what you are describing... so I wonder if that could be it.
Hope that helps!
Comment #8
Smudio commentedHi David,
yes, that was it ;-)
Thanks a lot, especially for showing the sample code!
Greetings from Berlin! Matthias
Comment #10
tmsss commentedHi there! I'm trying to load a node directly into overlay from a view link but I get the same weird behavior described by David and the page gets redirected to the node page instead of opening the overlay.
Here is my code:
Can you help me out?