Reputation: 12333
Suppose I have www.mycoolsite.com, and want to have a sub-section like www.mycoolsite.com/hino (yes, a car-sale with a subsection holding trucks).
The ugly fact here is, actually, divided into 2:
Now I created (i.e. copy-pasted, renamed, and successfully activated) another theme I already had. Both themes are active right now.
Actually, 3 themes are active right now, counting the latter: Normal theme for Desktop devices, Normal theme for Mobile devices, and Hino theme (for Desktop devices yet; the requirement for Hino/Mobile will come later).
Currently, the selected theme is Normal/Desktop unless a mobile device connects, in which case the theme is automatically switched to Normal/Mobile. BUT that's thanks to the device detector.
What I need is to render a completely different theme (i.e. the new Hino/Desktop theme) when a request is done to a node which I think it has to belong to a new content type I must create.
So, my qestion here: How do I create a new content-type and specify another theme for it? e.g. "modelos" content-type should render the Normal theme, but "modelos-hino" (a new content-type with different fields) should render the Hino theme.
Notes:
Upvotes: 0
Views: 239
Reputation: 74
Based on http://drupal.org/node/224333#custom_theme You could create a custom module and use the hook_custom_theme to load the node, check its type and trigger your new theme from there. Something like:
<?php
/**
* Implements hook_custom_theme().
*/
function mymodule_custom_theme() {
if (arg(0)=='node' && is_int(arg(1))) {
$node = node_load(arg(1));
if ($node->type == 'modelos-hino') {
return 'Hino';
}
}
}
?>
Upvotes: 1