I am making a module, each time user make content type and add fields to it, all its field values get rendered into static template dynamically.
For This ithis, I am using noad_load_multiple()noad_load_multiple()
to get all node values of selected content type and using hook_themehook_theme()
, displaying it in a static template page.
$compfields = [node_load_multiple][2](array(), array('type' => $node_type));
return theme('component_fields',array('compfields'=>$compfields));
$compfields = [node_load_multiple][2](array(), array('type' => $node_type));
return theme('component_fields',array('compfields' => $compfields));
In the template file, I am doing it like this way:
print '<p>'.$value->body['und']['0']['value'].'</p>';
byusing the following code, looping over $compfields
variable. Now my PROBLEM is : here
print '<p>' . $value->body['und']['0']['value'] . '</p>';
I know that my content type has a body field named body which followis rendered with print '<p>' . $value->body['und']['0']['value'] . '</p>';
pattern to get rendered. But If a user add some additional field, how
How can I render that fieldthe additional fields added to static html structure present in my templatea content type without knowing which type oftheir field he is going to add.type?