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.

CommentFileSizeAuthor
#2 tax_menu_vocab_count.patch1.07 KBtimaholt

Comments

filipes’s picture

Regarding 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

timaholt’s picture

Version: 6.x-2.x-dev » 6.x-2.9
StatusFileSize
new1.07 KB

Here's a patch file I made that does exactly what you are asking for here... I rolled it against 6.x-2.9

hles’s picture

Status: Active » Needs review
hles’s picture

Issue tags: -pathauto, -taxonomy menu

Removing tags

Status: Needs review » Needs work

The last submitted patch, tax_menu_vocab_count.patch, failed testing.

johnv’s picture

Title: Node count for vocabulary and terms (incl. child terms), but do not group descendants » 'Display number of items': (incl. child terms), but do not group descendants
dstol’s picture

Status: Needs work » Closed (outdated)

The Drupal 6 version is no longer supported