In certain (many?) scenarios, the 'Panelizer' items are not being added to the content types table at admin/structure/types.

Comments

damienmckenna’s picture

The page customization is dependent upon the theme - it works correctly with the Seven (core), Bartik (core), and Aurora themes, it does not work with Stark (core), Adaptive Theme v3, Corolla (based on Adaptive Theme v3), Ember, Garland (core), Omh (part of Omega v4), Omega v4, Zen v5. In each case that the links are not added it is because in hook_page_alter() there is no $page['content'] structure.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new3.36 KB

Added some extra comments to hook_page_alter.

damienmckenna’s picture

damienmckenna’s picture

Status: Needs review » Needs work

Ok, I've committed that small bit of code, will need to dig into the problem soon.

mglaman’s picture

StatusFileSize
new664 bytes

Note: I was a dunce and original posted comment/patch in the Omega queues issue for this.

In order to get it to work I had to move to the theme layer. Why? Not sure, but page_alter didn't have the content variables yet.

This is how I got it to work with existing code. I chose process over preprocess so that it runs last, hopefully avoiding anything running in preprocess and borking it p.

function panelizer_process_page(&$variables) {
  // Delegate.
  foreach (panelizer_get_plugins_with_hook('page_alter') as $handler) {
    $handler->hook_page_alter($variables['page']);
  }
}

I know page alter would be optimal, but I really do feel that this could solve problems across themes. It's probably a DrupalWTF. Attaching a patch so that people can at least patch Panelizer - or have this committed as a fix.

mglaman’s picture

Status: Needs work » Needs review

Forgot to mark needs review.

damienmckenna’s picture

  • DamienMcKenna committed e1d397a on 7.x-3.x authored by mglaman
    Issue #2212873 by mglaman: Panelizer links were not always added to...
damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thanks for working it out, mglaman!

  • DamienMcKenna committed 94cd01d on 7.x-3.x authored by mglaman
    Issue #2212873 by mglaman: Panelizer links were not always added to...

Status: Fixed » Closed (fixed)

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