By j0hn-smith on
I'm doing some testing and learning how Drupal works.
I know there are other ways to do this that involve modules such as related content however I want to use php code in the body of one node to display the content of another node. I have done some searches but can't find anything so basic.
Thanks
Comments
node_view() and node_load()
node_view() and node_load() will do that..
if you want to load a whole node into another node you can do so by adding something like this in the node's body:
node_load() requires node ID as the parameter, or an array of its properties like: array('name' => 'MyFirstNode')
node_view() renders an HTML output, which requires a node object as its parameter.
Hope this helps.
Yes it does, a lot. I'd
Yes it does, a lot.
I'd found node_view() but didn't know how to use it.
Many thanks
Brilliant
Who'd have thought that was so easy... now maybe someone can tell me how to make it display in a little block, say off to the left? Haven't tried this yet, but woud it work to go something like this...
And then put some css in my template's css file for "something"?
Or am I way way off?
comment_view?
This was most helpful.
I'm also trying to display the comments of a node. Is there a function like comment.view($node)?