By czollli on
Hello,
I'd like to include a page content before my CCK fields, but
not so as node reference does.
I'd like to show the referenced page for the users when they create the content so
they can read, then they can fill the following fields.
How would you solve this?
Best Regards
Czollli
Comments
HI what is the relationship
HI
what is the relationship between two nodes (i.e. [A]one that you are using as reference and [B]one you are creating)
if A is specific node that you want to reference i.e. lets say node with nid = 20
then you can write a form_alter hook in custom module and do the node load over there
the code will look similar to the following one
function [modulename]_form_alter(&$form, $form_state, $form_id){
if($form_id == '[nodetype]_node_form'){
$node = node_view(node_load(20)); // here 20 is the nid of the node
$form['ref_node'] = array(
'#value' => $node,
'#weight' => 0,
);
}
}
you will have to user your own context in place of values in [].
thanks,
Shashikant.
Isn't there any modul which do that?
Thanks anyway, I thought there is simpler way...