Non content-type title on metroz

+1
0
-1

Is there a way of making it so the "Conact-us" page will show "Contact us" instead of "Webform"?

+1
+1
-1

Hi Shvecht,

Yes, you can do it!
Follow step-by-step guide:

Step 1: Open file template.php in "tb_metroz" theme
Step 2: In function: tb_metroz_preprocess_node(&$vars)

At source code:
if (isset($vars['node']) && $vars['node']->type == 'webform') {
$vars['page'] = TRUE;
}
After
$vars['page'] = ($vars['type'] == 'page') ? TRUE : FALSE; // display node title

Step 3: In function: tb_metroz_preprocess_page(&$vars)
At source code:
//Hidden webform title
if (isset($vars['node']) && $vars['node']->type == 'webform') {
$vars['title'] = 'Contact us';
}
After
if (isset($vars['node']) && $vars['node']->type != 'page' && !in_array('page__node__delete', $vars['theme_hook_suggestions'])) {
$result = db_select('node_type', NULL, array('fetch' => PDO::FETCH_ASSOC))
->fields('node_type', array('name'))
->condition('type', $vars['node']->type)
->execute()->fetchField();
$vars['title'] = $result;
}

Thanks
Let me know if you have still any problems.

+1
0
-1

Worked great, thanks!