0
votes

I have a drupal 7 site that I want to make secondary front pages on. the problem with this is the "page--front.tpl.php" is a two column layout and the "page.tpl.php" is a one column layout. if i use a node template it shoves it in the body of the one column.

the theme name is "egress" the machine name for the content type is "landing" but when i try to hook the page--landing the same way i do the node--landing nothing happens. nothing.

i am clearing the cache and hard refreshing the page with every change of the template files.

one code i have tried in the of the "page.tpl.php"

function egress_preprocess_page(&$vars) {
    global $node;
    if ($node->type == 'landing') {
        $vars['theme_hook_suggestions'] = array('page__landing'); 
    }
}

another

function egress_preprocess_page(&$vars) { 
    if ($vars['node']->type == "landing_page") {
        $vars['template_files'][] = 'page--landing';
    }
}

anyone ideas?

1
try putting an exit; in your code to see if it's running, if it isn't try resetting your theme registry then seeing what happens.Royalty

1 Answers

0
votes

The following should go to your theme's template.php rather than page.tpl.php

function egress_preprocess_page(&$vars) {
    // For page--(node-type).tpl.php
    if (isset($vars['node'])) {
        $vars['theme_hook_suggestions'][] = 'page__'. $vars['node']->type;
    }