I'm not entirely certain if this is a bug, but it sure doesn't seem right. I'm using Drupal 7.16, Panels 7.x-3.3 and Panelizer 7.x-3.0-rc1, as well as a custom theme with 2 hook implementations (template_preprocess_node() and hook_form_FORM_ID_alter()).

The node preprocess hook triggers on nodes even with the node template page enabled in Panels, but not on nodes of a content type that is panelized. This is how the hook looks:

function ocs_preprocess_node(&$vars) {
    dpm($vars);
}

So I definitely know when it does or does not trigger. If this is by design, what are the alternatives? Does Panelizer provide its own equivalent hooks?

Comments

damienmckenna’s picture

Do you have the node's main "content" field displayed on the page?

merlinofchaos’s picture

Status: Active » Closed (works as designed)

template_preprocess_node() only happens when a node_view() is called; if you do not have the "node: content" pane in place, then node_view() will not be called. theme('node') will therefore never be called. This is not a bug, this is a complication of the interaction between Drupal, which doesn't really understand anything about Panelizer, and a system designed to do things in a completely different way.

Riari’s picture

Ah, bingo! I need to remember to use that instead of the body field, then. Thanks.