Treat the node nids as a field (for display only in a content type) in drupal 7 -
i need use nid of node field in content type: need choose print (put before fields after others) , format wish. thing think create "fake" custom field no widget insert buth theme formatter display seems me little complicated. how should it?
if understand correctly, want expose data node view. easy using hook_node_view() module?
with that, can set 'fake' field sent out content array of node, can access in node template.
from drupal.org:
<?php function hook_node_view($node, $view_mode, $langcode) { $node->content['my_additional_field'] = array( '#markup' => $additional_field, '#weight' => 10, '#theme' => 'mymodule_my_additional_field', ); } ?>
Comments
Post a Comment