I'm using Drupal 5.7 and Panels 5.x-2.0-beta3. I am creating a panels page and have selected to have all drupal blocks and regions overridden for this page.
In my main drupal install, I am using SEOposition as my main theme, but I use Bluemarine as my admin theme.
When I view the panel in Preview mode, I see the panel in the Bluemarine (admin) theme with sidebars properly suppressed. However, when I follow the direct link to the live panel page, I see the page in the SEOposition theme (which is what I want), however, blocks are no longer suppressed with SEOposition (which is not what I want).
I searched but did not find any clues for this problem. Not sure whether this is more likely an issue for Panels or for SEOposition. Can anyone suggest an idea for uncovering the source of the problem? (Keeping in mind you are dealing with someone with about a year and a half of Drupal experience, but little knowledge of the underlying code.)
Thanks.
Comments
Comment #1
sharique commentedsubscribing
Comment #2
muhleder commentedI spent yesterday trying to work this out and I think I know what the problem is. It's not a panels issue so I doubt it's going to get fixed unfortunately. The suppress blocks option is handled by phptemplate, but as far as I can see is only implemented for the left and right sidebars. ie blocks are only suppressed in the sidebars, not for header, footer or any custom regions. The following code from the phptemplate_page function in /themes/engines/phptemplate.engine is where it is implemented for the sidebars.
Line162
You could suppress other blocks by adding an extra conditional in the following piece of code, but the $show_blocks variable doesn't seem to be available in this function ( _phptemplate_default_variables ) again in /themes/engines/phptemplate.engine
Line 112
Maybe you could set a global variable when the suppress blocks option is tested in panels_page.module
Line 719
and then test for that variable in phptemplate.engine, or in your theme. Not sure that I'd want to hack a contrib module and a piece of code code myself.
It would be nice to have the option to suppress parts of your theme if on a panel page though, I think a better way to do it might be to test if the page is a panel page using one of the panel API functions. Not sure on the performance implications as it would be called on every page, but at least you wouldn't be hacking core or module code.
Comment #3
sharique commentedI put this code in page.tpl.php, but it didn't work.
Comment #4
muhleder commentedI tried that thing too, but the no_blocks variable isn't available. I'm using the following code in my page.tpl.php
or you can give all your panels urls like panels/* and just disable the blocks individually for that pattern
Comment #5
sdboyer commentedYep, as muhleder has pointed out, this really isn't a panels issue; there are ways of accomplishing the hiding of all blocks within the theme system itself, but being that they have nothing to do with panels, I'm marking this as by design.
Comment #6
dkruglyak commentedSeems to me this issue is relevant to what I am seeing with Panels3 beta2, so I am posting it here.
My panel is configured to disable blocks/regions and this works fine. However when I render it in "Preview" mode, these extra blocks do not go away. The result is panel tries to render in a much more constrained space, coming out looking wrong and occasionally spilling over the block regions.
I should add that this preview mode also does not include (or properly apply?) Panel's global CSS - which I am relying on for proper output.
Comment #7
merlinofchaos commentedThe preview just comes in in the administrative space that it has. It can't really make the blocks go away during preview. And if it ajaxes in, it might miss css. The preview is, well. Kind of weak. It's useful but not as good as it could be.
Comment #8
dkruglyak commentedWhat about putting preview into a Lightbox or iFrame?
There should be a way to do this. Preview is pretty much useless when constrained to admin box. That is a problem.
Comment #9
stieglitz commentedagreed this would be very nice!
Comment #10
dhakshinait commenteddisable custom regions in panel page:
1) go to template.php file
find the function " phptemplate_preprocess_page(&$vars) "
and put the following code in that function
if (!$panel_page->no_blocks) {
$vars['YOUR_CUSTOM_REGION'] = '';
}
FOR EXAMPLE.. I HAVE REGIONS CALLED "bottomside"
if (!$panel_page->no_blocks) {
$vars['bottomside'] = '';
}
i think , it will help someone.