Skip to content

Commit ec7d548

Browse files
authored
Merge pull request #46 from joelpittet/print-node
Ensure the type property exists before using it.
2 parents 4890a63 + f6c69d2 commit ec7d548

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

template.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ function megatron_process_block(&$variables, $hook) {
263263
function megatron_preprocess_page(&$variables) {
264264
// Define CLF page elements in an include
265265
include_once 'includes/template-ubc-clf-elements.inc';
266-
// Add template suggestions based on content type
267-
if (isset($variables['node'])) {
266+
// Add template suggestions based on content type.
267+
if (isset($variables['node']->type)) {
268268
//$variables['theme_hook_suggestions'][] = 'page' . theme_get_setting('clf_layout') . '';
269-
$variables['theme_hook_suggestions'][] = 'page__type__'. $variables['node']->type;
269+
$variables['theme_hook_suggestions'][] = 'page__type__' . $variables['node']->type;
270270
}
271271

272272
// Add information about the number of sidebars.

0 commit comments

Comments
 (0)