Drupal Camp Беларусь 18-19 мая 2019 в Минске.

Вывод родительских терминов словаря в блок

<?php

/**
 * Implements hook_block_info().
 */
function MYMODULE_block_info() {
  $blocks['product_category_links'] = array(
    'info' => 'Product category links',
    'cache' => 'DRUPAL_CACHE_GLOBAL',
  );

  return $blocks;
}

/**
 * Implements hook_block_view().
 */
function MYMODULE_block_view($delta = '') {
  // The $delta parameter tells us which block is being requested.
  if ($delta == 'product_category_links') {
    $terms = taxonomy_get_tree(2, 0, 1, true);
    $content = '';
    $links = array();

    foreach ($terms as $key => $term) {
      $path = taxonomy_term_uri($term);
      $links[] = l($term->name, $path['path']);
    }

    if (!empty($links)) {
      $content .= theme('item_list', array('items' => $links));
    }

    $block['subject'] = t('Products');
    $block['content'] = $content;

    return $block;
  }
}