Hi,
I would like a following feature to be added to Taxonomy Menu:
a) checkbox to display node count for each vocabulary
b) checkbox to display node count for a term + all its child terms, but not grouping them
c) and if term itself has 0 nodes, but child terms has some, instead of message "There are currently no posts in this category." something telling user to look to subcategories could be displayed
Feature b) will have 2 advantages:
- If user sees no attached node (for current term) but non-zero node count, he will go deeper to explore child terms.
- Currently if Display Descendants is on, the path is: "taxonomy/term/$tid $tid $tid $tid" and Pathauto can't translate it to nice URL. If b) is implemented path will stay "taxonomy/term/$tid" and if Pathauto is on, it will be translated to nice URL.
Current situation with Display Descendants off is:
Vocabulary 1
- category 1 (0) "There are currently no posts in this category." <= why would I open subcategories when I see (0) and this message?
- - subcategory 1 (0)
- - - subsubcategory 1 (3)
- - - - node 1
- - - - node 2
- - - - node 3
- - - subsubcategory 2 (0)
- - subcategory 2 (0)
Vocabulary 2
...
Current situation with Display Descendants on is:
Vocabulary 1
- category 1 (3) <= Pathauto is not working here
- - subcategory 1 (3) <= Pathauto is not working here
- - - subsubcategory 1 (3)
- - - - node 1
- - - - node 2
- - - - node 3
- - - subsubcategory 2 (0)
- - subcategory 2 (0)
Vocabulary 2
...
Suggested behaviour if a) and b) checkboxes are on and Display Descendants is off:
Vocabulary 1 (3)
- category 1 (3) "Please see subcategory" (or similar message) <= Pathauto works here, I can see there will be some nodes in child terms
- - subcategory 1 (3) "Please see subcategory" (or similar message) <= Pathauto works here, I can see there will be some nodes in child terms
- - - subsubcategory 1 (3)
- - - - node 1
- - - - node 2
- - - - node 3
- - - subsubcategory 2 (0)
- - subcategory 2 (0)
Vocabulary 2 (4)
...
I am not a PHP developer and not (yet) familiar with Drupal module development/patching, but I tried some really simple hardcoded test on taxonomy_menu.module (not using any cfg checkboxes or dB variables or internalization etc.) and the counts described above worked well I think.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | tax_menu_vocab_count.patch | 1.07 KB | timaholt |
Comments
Comment #1
filipes commentedRegarding c)
I noticed this is a taxonomy core module issue, so I created one there:
#786256: "There are currently no posts in this category." - but there are some in subcategories
Comment #2
timaholt commentedHere's a patch file I made that does exactly what you are asking for here... I rolled it against 6.x-2.9
Comment #3
hles commentedComment #4
hles commentedRemoving tags
Comment #6
johnvThese are duplicates, but have different solutions to the problem:
#1064510: 'Display number of items': Node count should include descendants
#784022: 'Display number of items': (incl. child terms), but do not group descendants
Comment #7
dstolThe Drupal 6 version is no longer supported