By kipper on
hi all!
sorry for my english...
I have the function by default inside my template.tpl.php of my theme > corporate:
<?php
function corporate_preprocess_page(&$vars) {
if (isset($vars['main_menu'])) {
$vars['main_menu'] = theme('links__system_main_menu', array(
'links' => $vars['main_menu'],
'attributes' => array(
'class' => array('links', 'main-menu', 'clearfix'),
),
'heading' => array(
'text' => t('Main menu'),
'level' => 'h2',
'class' => array('element-invisible'),
)
));
}
else {
$vars['main_menu'] = FALSE;
}
if (isset($vars['secondary_menu'])) {
$vars['secondary_menu'] = theme('links__system_secondary_menu', array(
'links' => $vars['secondary_menu'],
'attributes' => array(
'class' => array('links', 'secondary-menu', 'clearfix'),
),
'heading' => array(
'text' => t('Secondary menu'),
'level' => 'h2',
'class' => array('element-invisible'),
)
));
}
else {
$vars['secondary_menu'] = FALSE;
}
}
?>
If I add a function for theming page.tpl.php I get an error.
I want to insert the new code within the existing function ... you can help me in this?
This is the function to add:
<?php
function corporate_preprocess_page(&$variables) {
if (isset($variables['node']) && arg(2) != 'edit' && arg(1) != 'add') {
$variables['theme_hook_suggestions'][] = 'page__node__' . $variables['node']->type;
}
}
?>
Best Regards...
Comments
Change the bottom of the
Change the bottom of the existing function
to
Many Tanks!I have another
Many Tanks!
I have another thing to solve ... the thread title is fine and then write it here...
template.tpl.php
function:
function/code to add:
is for theming > html.tpl.php - html--myctype.tpl.php etc etc...
I will try to understand the logic of these changes
Thank you very much
ok... I find a
ok... I find a solution!
More Thanks...
Change $variables to $vars,
Change $variables to $vars, or vice versa accordingly.
love, light n laughter
Great! work fine!!! Thanks to
Great! work fine!!!
Thanks to both of you!