access node content from another node
I have one piece of content that needs to be accessed from two different nodes. I want to avoid having to duplicate the content. I thought I could create a node for the data and later access it from the other nodes?
Basically the problems is that two pretty different sections share some content. So the content will be the same but the design and layout of the page around that data (specially menus) will be different on both sections.
i guess this does not sound very well, but if i could from the second node's body insert a PHP call to pull the content of the first node's body content that would be a solution, i dont know much PHP or about the Drupal database structure and API. So I would apreciate any tips. many thanks
enrike

Are you using cck for the
Are you using cck for the node types and do both types edit, or is one simply display?
Here is how i did it (accessing nodes from other nodes)
Hi, hopefully this will be of help to you and others.
In your custom node, add a field that will take a string (LONGTEXT for example).
In your custom form, add a checkboxes type form and have the values correspond to the title and nid of the nodes you want to select from.
Use the php functions explode and implode respectively to turn the array of nids into a string to put into the database and turn the string into arrays when populating the checkboxes list.
When you select an item in the list, it will return an array of the values (the array) of nids you want to keep in the database.
In the form:
//Column name in database is different than the form name because of type conversion$form['other_nodes'] = array('#type' => 'checkboxes', '#title' => t('Nodes to Include'),'#options' => get_nodes_as_associative_array_using_titles_and_ids(),'#default_value' => explode(',',$node->the_other_nodes));When you submit, just do:
$node->the_other_nodes = implode(',',$node->other_nodes);In your view of the node, turn the string into an array again with expolode() and iterate over it and theme the nodes and display it:
//This would probably be best done in the theme function of you module/theme$output = '';$page_element_node_ids = explode(",",$node->the_other_nodes);foreach ($page_element_node_ids as $node_id) {//Use TRUE for a teaser view
$output .= node_view(node_load($node_id), FALSE);
}
print $output;Also, as a suggestion try reading up on drupal's design:
http://drupal.org/book/print/509
http://www.ibm.com/developerworks/ibm/osource/implement.html