After upgrading the module to -dev release the site_template stop functioning. The whole web site is rendering as missing completely the site_template (just each page content in the middle of the page, menus and page elements which are set up in site_template not rendering at all); when entering the "preview" in site_template page edit, the page render correctly...

Comments

sleeping_at-work-’s picture

I suppose this is the way:

Making Panels Everywhere aware themes     
=====================================     
     
To make a theme PE aware, all that really matters is to provide a default site    
template that matches what the theme's page.tpl.php should be. To do this,     
create a site template in your site. Export the handler via the bulk export     
mechanism. Edit your .info file to contain these lines:    
     
; We provide default page manager pages for our site template     
api[page_manager][pages_default][version] = 1     
api[page_manager][pages_default][path] = pages    
     
The bulk export will give you a .pages_default.inc file -- just place that in      
the 'pages' directory. Your new site template should be immediately available.    
     
It's a very good idea to add a 'selection criteria' so that this template will    
only activate when your theme is the active theme.     
    
You can also give your theme a hybrid mode where it will be smart and use its    
normal page.tpl.php if the site_template is not in use, and use a stripped     
down page.tpl.php if it is. Place the following code in your theme (chances     
are you already have a preprocess page).     
      
  function MYTHEME_preprocess_page(&$vars) {     
    if (!empty($vars['panels_everywhere_site_template'])) {     
      $vars['template_file'] = 'page-panels-everywhere';    
    }     
  }    
     
Then copy panels_everywhere/theme/page.tpl.php to     
page-panels-everywhere.tpl.php in your theme. Once this is done, your theme    
will play nice with Panels Everywhere even if the option to take over the    
page template is not enabled.    
     
There is rather a lot of information available via this variable if you like.     
The actual template used will be in $vars['panels_everywhere_site_template']['handler']    
and the contexts will be in $vars['panels_everywhere_site_template']['contexts'].    
merlinofchaos’s picture

Hmm. Did you try updating CTools at the same time? While I don't think any of the changes I made to PE should be affected by that, it's possible that they will be I suppose.

It's also possible that you just need to clear the theme registry.

sleeping_at-work-’s picture

Just tried, and no way out. I'm using last -dev release of Ctools and Panels Everywhere, and I've flushed all caches (including theme registry). If I select "Override the page template" I got my site_template working (but not rendering correctly as my theme is supposed to work with its own page.tpl.php).
If I go back to Panels Everywhere 6.x-1.1 everything goes ok (or simply changing the new panels_everywhere.module for the old one)...

merlinofchaos’s picture

Are you able to put some debugging in PE's page preprocess to see if maybe it's skipping the site template generation for some reason? In particular there's a function that checks to see if it should go to a fallback, that could be involved?

sleeping_at-work-’s picture

I'd have to debug this (well, I'm more a designer than a programmer, but I'll try). I've tried applying all the patches included in -dev version to the stable release and no problem with them, but the patch in the issue http://drupal.org/node/872260 generates the bug I'm reporting here. So, having a look around I guess the problem comes from here (Am I wrong - ? -),

http://drupal.org/node/872260#comment-3327300

Here's a new version of the patch. I found that PanelsEverywhere was being activated by merely turning on the site template. With this version, you need to explicitly enable the "Override page template" option (or do it per-theme).

Well, I'd like to use PE without enabling the "Override page template" option (as it was in stable release - to have more control on my page.tpl.php -), it's still possible?

sleeping_at-work-’s picture

StatusFileSize
new2.07 KB

I'd like to suggest to go back from

if (!panels_everywhere_should_override_theme()  

to

 if (variable_get('panels_everywhere_site_template_enabled', FALSE)) --- as it is in last stable release   

in panels_everywhere.module - to allow activate PE without enabling the "Override page template" for the ones who'd like to use their own page.tpl.php -

Here's a patch I've tested in my local environment, I'm just replacing a couple of lines with the old ones
Does it make sense to you? Don't know if I'm doing right!? (or the module will be supposed to work only if "Override page template" is enabled...?)

robin van emden’s picture

Status: Active » Reviewed & tested by the community

The patch at #6 helped out with the site_template issue, but it brought back issue [#866090 ]

robin van emden’s picture

Status: Reviewed & tested by the community » Needs work
sleeping_at-work-’s picture

thanks for testing

mcpuddin’s picture

Priority: Normal » Critical
Status: Needs work » Needs review
StatusFileSize
new2.95 KB

I have this exact same issue and the patch did not work well for me either. I have attached a cleanup/rework of the already contributed patch to address the issue in comment #7 (basically $registry['original page'] was not being included for non page.tpl.php overrides).

I am marking this as a critical issue because this is crippling to anybody wanting to make a site with panels everywhere by not overriding page.tpl.php.

mcpuddin’s picture

Title: After upgrading Panels Everywhere from 6.x-1.1 to 6.x-1.x-dev site_template stop functioning » Not checking "Override the page template" is not supported in most recent version of Panels Everywhere
perusio’s picture

Right on the money. I have the CTools stable release (1.8) and the PE 1.x-dev. It was rather strange. Somehow the default page handler that I placed in <theme_name>/pages> wasn't being picked by the CTools machinery.

I placed the following debug statement in my page.tpl.php

   print_r($panels_everywhere_site_template['handler']); 

Nothing was printed. Then I reverted back to the stable release of PE, 6.x-1.1, and nothing was printed, although now the template rendered correctly. After applying the patch in #10 to the dev version of PE I get the output of the debug statement:

stdClass Object ( [did] => 2 [name] => site_template_panel_context [task] => site_template [subtask] => [handler] => panel_context [weight] => 0 [conf] => Array ( [title] => Template CAV [no_blocks] => 0 [pipeline] => standard [css_id] => [css] => [contexts] => Array ( ) [relationships] => Array ( ) [access] => Array ( [plugins] => Array ( [0] => Array ( [name] => theme [settings] => Array ( [theme] => mytheme ) [not] => ) ) [logic] => and ) [temp_layout] => bricks_25_75_stacked [did] => 2 [display] => panels_display Object ( [args] => Array ( [0] => stdClass Object ( [title] => [content] =>(...)
mcpuddin’s picture

I'm glad that helped perusio ! Since you sound like you know code pretty well -- please change the status to "reviewed & tested by the community" so we can get this in the most recent version.

sleeping_at-work-’s picture

I've tested the patch and it seems ok! I'll test more during the day and I'll report if I find any bug.
Thanks for improving the patch. It would be great to have the "Enable Panels Everywhere site template on a per-theme basis" option available even if the "Override the page template" checkbox is not selected.

sleeping_at-work-’s picture

StatusFileSize
new1.45 KB

Here's a patch (to be tested)

mcpuddin’s picture

Hi Sleeping At Work,

I totally understand your request for patch #15 and I tested your patch however the panels everywhere module hooks in a little deeper than just the admin form. Check out the panels_everywhere_should_override_theme() function.

I'd love to integrate this into this issue and I believe it does relate to the larger issue of making panels everywhere support drupal sites not using 'override page.tpl.php'; however this in itself is a can of worms. Can you create a separate issue for the patch you have in #15 so we can discuss this integration?

Thanks!
James

sleeping_at-work-’s picture

Sure! Thanks for testing, I've posted the patch here: http://drupal.org/node/872260#comment-3856656

sleeping_at-work-’s picture

Status: Needs review » Reviewed & tested by the community

@mcpuddin
I've tested deeper the patch at #10:
if "Override the page template" checkbox is not selected it's all ok, but try

- selecting "Override the page template"
- selecting "Enable Panels Everywhere site template on a per-theme basis" and your PE-compatible theme
- change theme to a PE-no-compatible theme (e.g., Garland)

Going back to front-end (where I've activated Garland) I get a PHP error - it seems like Panels Everywhere site template is enabled for all themes
I don't know if this is something specific for my local environment, so it'll be great if someone can try by himself and report
Maybe a fix is to remove completely the patch posted by NigelCunningham @ http://drupal.org/node/872260#comment-3341716 and discuss the integration of the option to enable PE on a per-theme basis in the same issue (http://drupal.org/node/872260), as mcpuddin was suggesting

sleeping_at-work-’s picture

Status: Reviewed & tested by the community » Needs review

.

mcpuddin’s picture

Hi @sleeping-at-work,

Thanks for testing this more deeply. I was unable to reproduce this error -- I am actually in the dev stage of my site and I am using Garland and it works fine for me. Can you let me know what the PHP error is you are getting?

On another note, panels everywhere does not work at all on theme that have a theme_page() function instead of a page.tpl.php -- like Marvin or Chameleon -- because preprocess functions in general don't execute in that case.

Let me know about that PHP error so I can help to resolve this. Thanks again for your work.

sleeping_at-work-’s picture

Hi James,
you're right!, I've tried again and everything seems fine, I think it was something specific for my local environment

sleeping_at-work-’s picture

Hope more people can test the patch @ #10, so that it'll be possible to change the status to RTBC

mcpuddin’s picture

You can move it to RTBC, no? or do we need 2 people?

sleeping_at-work-’s picture

Hmmmm, well, maybe it will be better to have more opinions about the patch ( ... unluckily I'm not an "experienced developer" )

Reviewed & Tested by the Community ["RTBC"]
The patch has received a thorough review and test by one or more experienced developers, and they have deemed it as ready to be committed to the project.
One should not set their own patch to this status. Patches need to go through the review process. Some exceptions may be made if another developer voices their support, or when the patch is utterly trivial (e.g. fixing a spelling mistake in a comment). (...)

http://drupal.org/node/156119

perusio’s picture

Status: Needs review » Reviewed & tested by the community

Here, lets RTBC it. We have quorum for such I think.

dan_lennox’s picture

I recently ran into this same issue. Tested patch in #10 and it worked fine. I also could not reproduce the PHP error from #18.

Letharion’s picture

Assigned: Unassigned » Letharion

Assigning to myself so I remember to take a look at this one later.

kars-t’s picture

Assigned: Letharion » Unassigned

+1 for the patch in #10.

It does add "panels_everywhere_page_preprocess" again to the preprocess functions so PE can do its work with a normal theme.

I'd say it should be commited and the issue split up as the feature request for "enable PE for a specific theme even if 'override the template' is not active".

alfthecat’s picture

subscribing

Letharion’s picture

Assigned: Unassigned » Letharion

Re-assigning to myself as a reminder.

alfthecat’s picture

Confirming patch #15 works!

LGLC’s picture

Patch #10 works brilliantly for me, too. Thanks!

alysaselby’s picture

Has this issue been committed? If so, can anyone tell me to which version it was added. I've been using the patch in #10 since 2010, but cannot find a thread to verify that it has been added to a future version.

thanks,

damienmckenna’s picture

Title: Not checking "Override the page template" is not supported in most recent version of Panels Everywhere » "Override the page template" cannot be disabled
Assigned: Letharion » Unassigned
Issue summary: View changes
StatusFileSize
new1.58 KB

Shortened the title and rerolled the patch; I did change the whitespace slightly, to make the code fix the coding standards better, but as that was all I'm leaving the status as-is.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you for your patience.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.