You are here

function taxonomy_views_atom_render in Views Atom 6

Implementation of hook_views_atom_render().

File

./views_atom.module, line 183

Code

function taxonomy_views_atom_render($node, $entity_xml) {
  $taxonomy_xml = $entity_xml
    ->addChild('taxonomy');
  foreach ($node->taxonomy as $tid => $term) {
    global $base_url;
    $term_path = url(taxonomy_term_path($term), array(
      'absolute' => TRUE,
      'alias' => TRUE,
    ));
    $vocabulary = taxonomy_vocabulary_load($term->vid);
    $term_xml = $taxonomy_xml
      ->addChild('term');
    $term_xml
      ->addAttribute('name', $term->name);
    $term_xml
      ->addChild('link', $term_path);
    $term_xml
      ->addChild('label', $term->name);
    $term_xml
      ->addChild('title', $term->name);
    $term_xml
      ->addChild('subject', $term->name);
    $term_xml
      ->addChild('description', views_atom_sanitize($term->description));
    $term_xml
      ->addChild('vocabulary', $vocabulary->name);
  }
}