Closed (works as designed)
Project:
Modal Frame API
Version:
6.x-1.7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Sep 2010 at 19:36 UTC
Updated:
14 Nov 2013 at 22:27 UTC
Jump to comment: Most recent
Comments
Comment #1
markus_petrux commentedYou should be able to copy modalframe-page.tpl.php to your theme directory and Drupal should get that one. You may need to rebuild the theme registry. Then you can alter the contents of that template as you wish.
If that does not happen, there may be something odd in your installation.
You can also override the stylesheets provided by Modal Frame API using a copy in your theme that's referenced in your theme's .info file.
Other that that, I'm unable to reproduce this issue. It just works here.
Comment #2
Michsk commentedaha ok, so i figured out that this does not work when the file is in a folder.
WORKS:
/sites/all/themes/theme/modalframe-page.tpl.phpDOES NOT WORK:
/sites/all/themes/theme/templates/modalframe/modalframe-page.tpl.phpSo this does count as a bug right?
Comment #3
Michsk commentedwtf now it also works in subdirs... i have no idea what happend, maybe caching of the iframe in my browser? No idea, thanks anyway.
Comment #4
Michsk commentedNo. this issue is still there. Only works when you place the template in your main template folder, placing it in a subdir doesn't work. I just doesnt overwrite then.
Comment #5
markus_petrux commentedI think Drupal is able to scan subdirectories of the theme. Well, we have a theme where all template overrides are located in MYTHEME/templates and I do not recall we did anything special to get that working.
So I cannot reproduce your issue either yet.
Comment #6
Michsk commentedyes drupal is able to do that, but this is the only case where it does not work for me. anyway i can not provide more info, so might as well close this.
Comment #7
markus_petrux commentedhmmm... you may also need to override the page.tpl.php. ie. copy this one also to the same place you want the one that uses modal frame. Clear the Drupal caches after changing this kind of things.
PS: "needs review" is tobe used when there's a patch for review. Meanwhile, since I cannot reproduce, let's leave it as "needs more info".
Comment #8
Michsk commentedgood point, i'll check this tomorrow.
Comment #9
mattiasj commentedI would personally be very fond of the idea that the body had a unique class in the modalframe-page.tpl so that it could be styled different. Then we wouldn't even need to use the template.
Comment #10
markus_petrux commented@mattiasj: The modalframe template provides a wrapper for the whole content with a unique class. Doing this also for the body, if that helps, then that's a good idea, but please open a separate feature request (we're trying to deal with a "bug report" here), and it would also be nice if that comes with a patch. I would be glad to review and commit that in short time. Thanks
Comment #11
jghyde commentedJust a tip on how to force the modalframe-page.tpl.php. In phptemplate_preprocess_page ():
?>
Comment #12
tsi commentedI've found that the only condition is that modalframe-page.tpl.php and page.tpl.php must be in the same directory, works for me in both theme root or theme subdirectory.
Comment #13
tpainton commentedI have to say, that I have the same problem I copied modalframe-page.tpl.php to my theme folder. The same directory also holds page.tpl.php. I cleared server cache, I rebuilt the theme registry but I do not get the custom modalframe-page.tpl.php. IN fact, my modalframe-page.tpl.php is blank yet I still get the page content in a modal frame. I have changed browsers as well, and loaded page using ctrl-f5.. I'm at a loss. I use custom templates all the time.
Comment #14
tpainton commentedOkay, now it's really bizarre. The custom modalframe-page.tpl.php is used from automodal links but not from links that only use automodal API alone. Why on earth would this be happening. Investigating further.
Comment #15
tpainton commentedI am wits end. I have uninstalled automodal fearing that it might be part of the trouble. I am calling my modal windows, which open just fine using a very simple js file..
I have copied modalframe-page.tpl.php to my theme's template directory where there is also the original page.tpl.php file. I have changed themes to reset the theme registry. I have flushed cache from the Dev menu, I have flushed the browser cache and I am still getting sidebars, headers, and footers in modal child windows when the url is
l('node', 'node/343', array('attributes' => array('class' => 'modalframe-child'))called.I can't imagine that this isn't some sort of bug... Unless someone can point me to where I am making an error?
/edit.. Not theme related. Persists in all themes.
/edit I THINK I JUST REALIZED MY FOLLY. I had my modalframe_child_js() commented out.. testing.
Comment #16
tpainton commentedYes, I solved it. I forgot that I had commented out modalframe_child_js() when I was messing around with automodal. Well. That was a great 2 hours spent pouring over the modalframe code looking for a bug. I should have known better. I would venture that this is the original problem that started the whole post. For me, this was a custom node, so I just added modalframe_child_js() to my hook_view(), but if one is viewing a stock drupal node then the hook_view() needs to be altered to include the modalfram_child_js(). If this isn't done, then one would get this issue. Personally, I never dreamed the modalframe_child_js() was commented out because I assumed without it, the modal would not open.. It does, just not in a pretty way.
Comment #17
dsnopekAs for the original issue: this is well known Drupal 6 bug - you have to have the main template (ie. page.tpl.php) in your theme before Drupal will find any of the suggestions for it (ie. modalframe-page.tpl.php). It's fixed in Drupal 7. ;-)
It looks like the @tpainton was able to solve his problem himself. Closing!