Forums
Hi, I would like to create a custom layout for a custom content-type, for instance the content type 'klantpagina'. In 'normal' Drupal I would add a function to template.php like this:
function platon_preprocess_page(&$variables, $hook) { $alias = drupal_get_path_alias($_GET['q']); if ($alias != $_GET['q']) { $template_filename = 'page'; //Break it down for each piece of the alias path foreach (explode('/', $alias) as $path_part) { // Added the str_replace becayse path parts with - were not being picked up properly by the theme_hook_suggestions $template_filename = $template_filename . '' . str_replace("-", "_", $path_part); $variables['theme_hook_suggestions'][] = $template_filename; }
}
if (isset($variables['node'])) { $variables['theme_hook_suggestions'][] = 'page__type'. $variables['node']->type; $variables['theme_hook_suggestions'][] = "page__node__" . $variables['node']->nid; }
}
how would I do this in Opigno? BTW, I am NOT a PHP-programmer, I just used this piece of code I found somewhere...
Hi Ton,