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, I am using noad_load_multiple()
to get all node values of selected content type and using hook_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));
In the template file, I am using the following code, looping over $compfields
.
print '<p>' . $value->body['und']['0']['value'] . '</p>';
I know my content type has a body field which is rendered with print '<p>' . $value->body['und']['0']['value'] . '</p>';
.
How can I render the additional fields added to a content type without knowing their field type?