function chado_get_node_title

2.x chado_get_node_title($node)

Get the title of a node based on the Title Format set in the admin section of the module. If the format has not yet been set than the the unique constrain and name fields will be used to generate a default format


$node: The node object

Related topics

33 calls to chado_get_node_title()
chado_analysis_load in tripal_analysis/includes/
Implements hook_load(). When a node is requested by the user this function is called to allow us to add auxiliary data to the node object.
chado_contact_load in tripal_contact/includes/
Implements hook_load().
chado_example_load in tripal_example/includes/
Implementation of hook_load(). This function is necessary to load into the $node object the fields of the table form Chado. For example for the example table, the chado_example_load() function adds in a example object which contains all of the fields…
chado_featuremap_load in tripal_featuremap/includes/
Implements hook_load().
chado_feature_load in tripal_feature/includes/
Implements hook_load().

... See full list


tripal_core/api/, line 196
Contains API functions to set titles and paths for all chado nodes


function chado_get_node_title($node) {
  $content_type = $node->type;

  // Get the tokens and format
  $tokens = array(); // this will be set by chado_node_get_title_format
  $title = chado_node_get_title_format($content_type, $tokens);

  // Determine which tokens were used in the format string
  if (preg_match_all('/\[[^]]+\]/', $title, $used_tokens)) {

    // Get the value for each token used
    foreach ($used_tokens[0] as $token) {
      $token_info = $tokens[$token];
      if (!empty($token_info)) {
        $value = chado_get_token_value($token_info, $node);
        $title = str_replace($token, $value, $title);
  else {
    return $title;

  return $title;