Closed (duplicate)
Project:
Taxonomy context
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 May 2008 at 20:27 UTC
Updated:
26 Feb 2009 at 19:06 UTC
Jump to comment: Most recent file
Comments
Comment #1
momper commentedsubscribe +1
Comment #2
mr.neil commentedHere's a patch that optionally displays the number of nodes for each term. And since the two ideas are closely related, I've also added the ability to not display terms without any nodes associated with them. (I call them "empty terms.")
After applying the patch, there will be two new options in the configuration settings (admin/settings/taxonomy_context): "show term count" and "show empty terms." Term counts are disabled and empty terms are enabled by default, which results in pre-patch behaviour. You will have to go to the configuration settings and specifically enable these settings after you apply the patch.
I found when term counts are enabled, the default garland theme--maybe others, too--displays the term and count on separate lines in the context menu block for a specific vocabulary. I just changed garland's style.css section below from block to inline-block and it seems to be working fine.
Please let me know how it works for you.
Comment #3
Vic96 commentedI'm not able to patch this. I get:
Hunk #1 FAILED at 378.
Hunk #2 FAILED at 428.
Hunk #3 FAILED at 478.
Hunk #4 FAILED at 497.
Hunk #5 FAILED at 601.
Hunk #6 FAILED at 622.
Hunk #7 FAILED at 666.
Hunk #8 FAILED at 715.
What could be wrong? This seems like a very useful module. It would be great if you could commit changes to the module itself. Thanks.
Comment #4
mr.neil commentedThat's strange. Since I am new at this (contributing to Drupal module development), I thought I had messed something up. But I got it to patch fine.
Here's what I did:
patch < taxonomy_context_show_empty_terms_count_subterms.patchWould those be the correct steps to follow?
Comment #5
Vic96 commentedDidn't work for me. Does the 5.x-2.x version include the patch?
Comment #6
mr.neil commentedTo everyone: Hmm, that's weird. Is anyone other than Vic96 having problems?
To Vic96: Would you like me to post my complete patched module? Unless someone else has ported it (and I doubt that's happened since I posted it a week ago), the 2.x-dev version does not include the patch. But if you would like to do that--or even commit the patch to the 1.x branch as you mentioned earlier--you're welcome to do so. I just don't think I'm quite ready to tackle that learning experience yet. (:
Comment #7
humanoid commentedHi mr.neil,
I need this function to show only terms which have nodes assigned to. But I was also not able to patch the file. It would be great if you post the patched module.
Thanks very much for your contribution!
Jürgen
Comment #8
giorgio79 commentedHow is the srcipt doing from a performance perspective?
Lets say I have a hieararchical category with 4-5 levels 30 000 terms and 200 000 nodes? :)
Comment #9
mr.neil commentedHere is the complete patched module. (Replace the original module file with this one; be sure to rename the new file the same as the old one.) If anyone can figure out why it doesn't patch properly for some people, please let me know.
And giorgio79, I don't know the answer to your performance question. But could you try it for all of us who are curious and follow up? I'd be interested to know the results.
Comment #10
summit commentedSubscribing. greetings, Martijn
Comment #11
momper commentedi tried the module of #9 - i get a "page not found" in the administration area clicking the taxonomy context menu item?? my fault?
greetings momper
Comment #12
momper commentednow it works - sorry - cache?? it's not a long period test - but seems to work well for the moment ... :)
greetings momper
Comment #13
nancydru#110374: Link's (node's) counter