How do I control the output of a node rendered inside a specific region?
Inside Sidebar First
, I can theme blocks by creating a block--sidebar-first.tpl.php
template file. However, creating a node--sidebar-first.tpl.php
does not work.
How do I control the output of a node rendered inside a specific region?
Inside Sidebar First
, I can theme blocks by creating a block--sidebar-first.tpl.php
template file. However, creating a node--sidebar-first.tpl.php
does not work.
Unfortunately, Drupal doesn't have support to have node template based on region. You can check out this link.
If you want to achieve your goal you can use Display Suite module. Here are some screen-casts about how to control your content with Display Suite. Here's also a comment about this.
For theming a node
first thing you need a custom node template
file.
Inorder to do that copy your node.tpl.php
and rename it as node-[ur_node_name].tpl.php
.
Now you have created a custom node template. In case of blog entry my node name would be node-blog.tpl.php
[Drupal-6] and it would be node--blog.tpl.php
[Drupal-7].
NOTE:
Make sure the [ur_node_name]
part is the machine readable name
.Now in your new node template
give your corresponding styles and print the contents of the node.This is how you theme a node
.Hope this helps you... :)