I am trying to programmatically create a block that will display all of the children of the term being referenced by the current page in a linkable table (so that I can click on any of the taxonomy terms and then go to their page). So far I have managed to create an ordered list of children names with the following code:
function children_view_block_view($delta = '') {
$block = array();
switch ($delta) {
case 'children':
$path = explode('/', drupal_get_path_alias($_GET['q']));
$tid = array_pop($path);
$term = taxonomy_term_load($tid);
$children = taxonomy_get_children($term->tid, $term->vid);
$stack = array();
foreach ($children as $child) {
array_push($stack,$child->name);
}
$theme_args = array('items' => $stack, 'type' => 'ol');
$content = theme('item_list' , $theme_args);
$block = array(
'subject' => t('Children'),
'content' => $content
);
break;
}
return $block;
}
But what I really want is a table that might contain some other details about the taxonomies but more importantly I would like each taxonomy in the list to be a link that will take me to that taoxnomies term page. I image the reason these terms are not linkable is because I am only passing the name into the array but when I tried to pass the actual term into the array I get an error from the theme module. How would I make these linkable? Also, I imagine that I could change the ordered list into a table by replacing the 'ol' in the call:
$theme_args = array('items' => $stack, 'type' => 'ol');
with a table but I am not sure what I would pass instead of 'ol' and I could not find any documentation about this. Could anyone link me to such documentation?