Discussion:
Theming different node types
Stefan Nagtegaal
2003-12-03 22:18:08 UTC
Permalink
Is it possible to determine which node-type is being outputted and return
all the node-types in a different way?

I think about something like this, but that doesn't work:

<code>
function mytheme_node($node, $main = 0, $page = 0) {
switch($node->type) {
case 'blog':
$output .= "That's the way. Uh-huh uh-huh! I like it. Uh-huh,
uh-huh!";
break;
case 'book':
$output .= "That's the way. Uh-huh uh-huh! I like it. Uh-huh,
uh-huh!";
break;
case 'story':
$output .= "That's the way. Uh-huh uh-huh! I like it. Uh-huh,
uh-huh!";
break;
case 'forum':
$output .= "That's the way. Uh-huh uh-huh! I like it. Uh-huh,
uh-huh!";
break;
case 'event':
$output .= "That's the way. Uh-huh uh-huh! I like it. Uh-huh,
uh-huh!";
break;
case default:
$output .= "Default way of outputting nodes";
break;
}
return $output;
}

</code>

Could someone tell me why this isn't working and what I should/could do
about it to let it work?



Stefan
--
[ Drupal user list | http://list.drupal.org/ ]
[ http://lists.drupal.org/options/drupal-user/gcpdu-drupal-user%40gmane.org ]
Loading...