Dear all,

I have made a site in which I declared 2 content types, 1 is like story's and one is a picture. The content type story has also a drop dropdown list which is the same in the picture content type.
Now I want to combine these both contents based on the dropdown. In general the story are posted once a week, the picture is a one time action.
Node like:


Both have matching field.

Marcel

Comments

kvaes’s picture

htca’s picture

I added the node reference to the node, than I am not able to see the picture (source) of the referenced node in the content-template option.
I will explain a little more;
The node with the content contains a weekly report of a footballsquad. I want to attach the teamphoto of the squad automatically in the output of the node.
The footballsquad foto does not change (only once a year), but I have several weekly reports of course in a year related to the squad. For example if I get a report of a match of squad C4, I want the team photo of C4 above or below the body of the report.
I already have a field with the teamname (i.e. C4 as above).

I almost think that I have to write some dedicated php for this, however, I cannot imagine that no one run into this before.

htca’s picture

I added the following code to the content template:

if ( $node->field_elftalfoto[0]['nid'] <> 0 ) {
$foto_nid = $node->field_elftalfoto[0]['nid'] ;
$foto_node = node_load($foto_nid);
$foto_node = node_build_content($foto_node);
$foto_desc = $foto_node->field_foto[0][view];
print $foto_desc;
} else {
print "<strong>Send us your picture to put it here</strong>";
}

of course field_elftalfoto is the referenced node.