By sisyphus on
suppose i create a block and want to print out something when the content is showing a certain type of node, say, blog. how to code it in the block? i wrote this: print $node->type; and show nothing. how to get the current node type?
thanks a lot.
Comments
looks like the right code.
looks like the right code. where did you put the print statement?
Blocks do not have a $node
Blocks do not have a $node variable, if you want the block to do something based on the current node you need something like
Thanks for the tip.
Thanks for the tip, nevets.