Hide terms with no nodes assigned
mishhh - March 19, 2007 - 13:17
| Project: | Taxonomy dhtml |
| Version: | HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I don't know if this should be a feature request or a bug.
Terms with no nodes assigned to them should not be displayed.
Of course a method would be to delete those terms, but it is better to not display them.
What do you say?
This should be interpreted also as a support issue for me:P because I don't know how to avoid displaying terms with no nodes assigned to them (and keep these terms in vocabulary, not delete them).

#1
This is definitely feature request. Others would complain that empty terms are not displaying :-) I think it is pretty easy, add settings checkbox and then limit the list to non empty terms (possibly in SQL query?).
I have too much work now, can you try? :-) Thanks
#2
I would do if I could... Now I'm not yet prepared for such modifications, but I'm learning...
The modifications you talk about are not hard to understand, theoretically:)
Hey is someone here to help us?:P:P
#3
Here is what I've done for taxonomy dhtml block to display only terms with associated nodes.
In the taxonomy_dhtml_vocab_vert() function I've permitted the displaying only of those terms with $count > 0 . It is a little modification:
from this:
$link = l(t($term->name), $url, array("title" => t($term->description)));// $out .= _taxonomy_depth($term->depth, " ")."- $link";
$out .= str_repeat(" ", $term->depth) . "- $link";
$count = taxonomy_term_count_nodes($term->tid);
if ($count) {
$out .= " ($count)";
}
$out .= "<br />";
to this:
$count = taxonomy_term_count_nodes($term->tid);
if ($count) {
$link = l(t($term->name), $url, array("title" => t($term->description)));
// $out .= _taxonomy_depth($term->depth, " ")."- $link";
$out .= str_repeat(" ", $term->depth) . "- $link";
$out .= " ($count)";
$out .= "<br />";
}
#4
This is NOT that easy :-( I am working on it right now and it needs too much tweaking:
- What if the only term which has nodes is subterm of some master term? Then we should print a master term
- This doesn't solve the same on taxonomy dhtml page
This is very minor, so i am lowering the priority, i personally doesn't have enough time to do this. Anybody?
#5
This module is no longer being actively developed as it duplicates functionality that can be obtained through the usage of taxonomy_menu ( http://drupal.org/project/taxonomy_menu ) and dhtml_menu ( http://drupal.org/project/dhtml_menu ).