I got to my Panelized page, for example http://mysite.com/#overlay=node/1/panelizer/content

This page has a custom Panels layout with a couple of regions. In those regions I have placed Minipanels (with custom layouts) or nodes. The Minipanels all have nodes in their regions. Those nodes are custom content types and they all have custom tpl-files, like node--my_content_type.tpl.php.

The problem is that when I hit the Preview button at the bottom of the page all the custom node templates are ignored. Every node uses the node.tpl.php template, instead of their own node--my_content_type.tpl.php.

The custom Panels layout is used correctly though.

How do I make the Preview use my custom templates for my nodes?

Comments

merlinofchaos’s picture

Status: Active » Fixed

The panelizer content page usually runs in the admin theme; so the preview probably also runs in the admin theme. If your templates are in the normal site theme, it won't know to use them. Therein lies your problem, I expect.

jisuo’s picture

Sounds reasonable.

After googling the problem and I tried to add this to my admin theme (called vyo_admin) template.php but it didn't work (the default page theme is called vyo). Any ideas?

function vyo_admin_menu_alter(&$items){
    // Add own theme callback to panels admin page for override
    $items['admin/structure/pages/%ctools_js/operation/%page_manager_cache']['theme callback'] = 'vyo';
}

/**
 * Custom theme callback for panels preview
 */
function vyo_admin_preview_theme() {
    $args = arg();
    // If last URL argument is preview, then set frontend default theme
    if (array_pop($args) == 'preview') {
        return variable_get('theme_default', 'vyo');
    }
}
merlinofchaos’s picture

I don't think the theme can do menu_alter -- you'll need to put that in a custom module I think.

Status: Fixed » Closed (fixed)

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