function chado_feature_view
1.x tripal_feature.module | chado_feature_view($node, $teaser = FALSE, $page = FALSE) |
This function customizes the view of the chado_feature node. It allows us to generate the markup.
Related topics
File
- tripal_feature/
tripal_feature.module, line 1806 - @todo Add file header description
Code
function chado_feature_view($node, $teaser = FALSE, $page = FALSE) {
if (!$teaser) {
// use drupal's default node view:
$node = node_prepare($node, $teaser);
// if we're building the node for searching then
// we want to handle this within the module and
// not allow theme customization. We don't want to
// index all items (such as DNA sequence).
if ($node->build_mode == NODE_BUILD_SEARCH_INDEX) {
$node->content['index_version'] = array(
'#value' => theme('tripal_feature_search_index', $node),
'#weight' => 1,
);
}
elseif ($node->build_mode == NODE_BUILD_SEARCH_RESULT) {
$node->content['index_version'] = array(
'#value' => theme('tripal_feature_search_results', $node),
'#weight' => 1,
);
}
else {
// do nothing here, let the theme derived template handle display
}
}
return $node;
}