Great module, however the Alphabetical layout provided by default was a bit limited for our purpose. Would you be able to include an option to change layouts? It would make the module a little more flexible :)

I modified the theme function to present the block slightly differently, more like folders really (please see the attached). There might be better implementation than what I have done below but thought I would post it up incase anyone finds it helpful.

  • I turned off the block title and put in page title in to show what the sub categories are children to, wrapped this in an if so it only shows if sub categories are available
  • Added Term Descriptions to give a bit more detail for each term
  • Created a clickable div so it is more of a button / folder shortcut

PHP in template.php

function knowledge_taxonomy_term_children_content($content) {  
  $module_path = drupal_get_path('module', 'taxonomy_term_children');
  $full_path = $module_path . '/taxonomy_term_children.css';
  drupal_add_css($full_path);
  
  // get page tile & only display if subcategory content is available
  $parent_cat_title = drupal_get_title();
  if ($content) {
  $output .= '<h3>' . $parent_cat_title .' subcategories</h3>';  
  }

  // changes the alphabetical headed layout to a list of subcategories with term descriptions
  $output .= '<ul class="categories">';  
  foreach ($content as $letter => $object) {
    foreach ($object as $term) {
       $output .= '<li class=$letter><div class="clickable-div">' . l($term->name, 'taxonomy/term/' . $term->tid) . $term->description . $node->title . '</span></li>';  
    }     
  }  
  $output .= '</ul>';
  return $output;
}

jQuery

//clickable divs
$(".clickable-div").click(function(){
     window.location=$(this).find("a").attr("href");
     return false;
});

New CSS

#block-taxonomy_term_children-0 ul.categories li {
width:50%;
margin: 0px;
padding: 0px;
}

#block-taxonomy_term_children-0 ul.categories li div  {
background: url("../images/icons/16x16/folder.png") no-repeat scroll 4px 6px #EBEBEB;
border:1px solid #ccc;
margin: 4px;
padding: 4px 4px 4px 26px;
cursor:pointer;
}
CommentFileSizeAuthor
CS&B - Knowledge_1294406094374.png21.52 KBwestie

Comments

marcoka’s picture

good idea, thanks for that. i discovered some issues with the default layout too. i am using it in my drupalwiki.
i will integrate a theme switcher/style in the next version i think.

marcoka’s picture

Status: Active » Closed (fixed)

as this is possible with views, this module is obsolete.