Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vladdancer/7097657 to your computer and use it in GitHub Desktop.
Save vladdancer/7097657 to your computer and use it in GitHub Desktop.
Add tpl based on delta name.
function yourtheme_preprocess_page(&$vars) {
$contexts = context_active_contexts();
// Add delta based tpl.
foreach ($contexts as $context) {
if (isset($context->reactions['delta']) && ($delta_name = $context->reactions['delta']['delta_template'])) {
$vars['theme_hook_suggestions'][] = 'page__'. $delta_name;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment