I created a new content type with several fields in it. How would I print out those fields anywhere on the page that I need them like in the sidebar and other areas? What is the syntax for printing out a field? Also, I think I have to name a PHP file after the content type. What do I name it in Drupal 7?
I think the question is how to put fields from a node to the page itself. You have to use hook_page_alter() and you can do something like this:
$page['sidebar_first']['node_links']=$page['content']['system_main']['nodes'][$nid]['links']; for putting node links in the sidebar.
For a field from a node you can do something like this:
$nid si the desired nid from the
The idea is that you can modify anything that a region contains and you can easily create blocks in any region with this hook.
I think you should install the devel module and do a
You'll be able to see all the data contained in the node and therefore, you'll be able to use them as you want.