Sunday, April 18, 2010

Center your block vertically using css

http://blog.themeforest.net/tutorials/vertical-centering-with-css/

Drupal display taxonomy terms for particular vocabulary


$vid = 3; /* <---- put correct vocabulary ID here */
$terms = taxonomy_get_tree($vid); /* need code from below to handle nesting */
print "
    ";
    foreach ( $terms as $term ) {
    $count = db_result(db_query("SELECT DISTINCT COUNT(nid) FROM {term_node} WHERE tid = %d ", $term->tid));
    if ($count) { /* don't show terms with 0 count */
    print "
  • ".l($term->name .' ('. $count .')', "taxonomy/term/$term->tid") ."
  • ";//this creates a link to the term
    }
    } /* end foreach */
    print "
";
?>