You are here

function taxonomy_list_nodes_render in Taxonomy List 5.2

Same name and namespace in other branches
  1. 5 taxonomy_list.module \taxonomy_list_nodes_render()
  2. 6.2 taxonomy_list.module \taxonomy_list_nodes_render()
  3. 6 taxonomy_list.module \taxonomy_list_nodes_render()
  4. 7 taxonomy_list.module \taxonomy_list_nodes_render()

Select and render the nodes in the chosen vocabularies.

1 call to taxonomy_list_nodes_render()
taxonomy_list_show in ./taxonomy_list.module
Show the category list

File

./taxonomy_list.module, line 673
List all terms in a vocabulary.

Code

function taxonomy_list_nodes_render($vids, $max_depth, $type = NULL) {
  $output = '<div class="taxonomy-list">';
  $terms = array();

  // Get vocabulary names and list of tids.
  foreach ($vids as $vid) {
    $vocab = taxonomy_vocabulary_load($vid);
    $vocab_titles[] = $vocab->name;

    // Taxonomy_select_nodes will do the depth part for us, so we just get the top terms.
    $terms = array_merge($terms, array_map('_taxonomy_get_tid_from_term', taxonomy_get_tree($vid, 0, -1, 1)));
  }
  drupal_set_title(implode(variable_get('taxonomy_list_title_separator', ' & '), $vocab_titles));
  sort($terms);

  // Render all nodes in a pager using taxonomy function.
  $output .= taxonomy_render_nodes(taxonomy_list_select_nodes($terms, 'or', $max_depth, $type));
  $output .= '</div>';

  // class="taxonomy-list"
  return $output;
}