Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I worked a bit on the dev version to add 3 new options:
1) To be able "not to" expand the menu by default (it seems the variable already existed but not configurable)
2) To be able to display only terms linked to nodes (I didn't specify which content types, but very easy to add this option)
3) To be able to display all nodes related to each term in the menu
As I'm a nerd with Git, I send you the whole zip. For those interested, changes has been made only in taxonomy_menu_form_alter(), taxonomy_menu_vocab_submit() and taxonomy_menu_handler() of taxonomy_menu.module
Cheers
Comment | File | Size | Author |
---|---|---|---|
#37 | taxonomy_menu_undefined_method_fetchfield-1192084-1.patch | 588 bytes | firebird |
#34 | sync-menu-1192084-#34.patch | 9.44 KB | dstol |
#24 | new-options-1192084-5.patch | 10.24 KB | firebird |
#22 | new-options-1192084-4.patch | 10.21 KB | firebird |
#20 | new-options-1192084-3.patch | 9.64 KB | firebird |
Comments
Comment #1
lahode CreditAttribution: lahode commentedHi,
After checking all my work of last Friday, I discovered there was already an function "_taxonomy_menu_term_count" for the functionality "To be able to display only terms linked to nodes"
So I fixed it and changed my code.
I still have 2 issues:
1) When changing the name of a term, it doesn't change it in the menu
2) If I delete a node or change the category, it stays at the same position in the menu.
However, globally it works well
Cheers
Comment #2
dreamdust CreditAttribution: dreamdust commentedThank you! Works great.
Comment #3
dstolPlease post a patch! http://drupal.org/node/707484 http://drupal.org/project/taxonomy_menu/git-instructions
Comment #4
lahode CreditAttribution: lahode commentedHi,
The zip was done with a previous version of taxonomy_menu, I quickly checked the diff with the last version and created a patch. I didn't have time to test it, but it should work.
Comment #6
lahode CreditAttribution: lahode commentedHi,
I was made it too fast last time. Try this one it worked for me.
Cheers
Comment #7
waynedpj CreditAttribution: waynedpj commentedthanks for the patch. i have been looking for a way to add menu items for nodes under each term https://drupal.org/node/1293538
since that was one of your added features i tried to apply the patch to Taxonomy Menu 7.x-1.2 but received the following:
the rejection file is attached.
however, both the expand option and children nodes are now working. it is safe to continue to use this patch if it did not totally apply cleanly?
regardless, thanks for the help. i will be happy to test additional patches for you.
peace
Comment #8
waynedpj CreditAttribution: waynedpj commentedi just realized that my problems in https://drupal.org/comment/reply/1192084/5049792#comment-5049792 were due to me not patching against the 7.x-1.x-dev version, instead of the 7.x-1.2 version which i had done. the patch does apply cleanly and seems to be working here with Drupal 7.8.
thanks again.
Comment #9
groovehunter CreditAttribution: groovehunter commentedthe patch from #6 worked for me against current 1.x-dev : adding nodes as childs is fine, expand / not expand is fine, but hiding terms without nodes not yet.
thanks and keep up the good work - Showing number of nodes in brackets would be next on my wishlist :)
Comment #10
calculus CreditAttribution: calculus commentedsubscribe
Comment #11
ranx CreditAttribution: ranx commentedsubscribe
Comment #12
lahode CreditAttribution: lahode commentedHi again,
Please don't suscribe my previous patch, it was dirty work. Today I completely reviewed the changes and it should be better to submit this one.
Please check before if something fail
Cheers
Comment #13
rp7 CreditAttribution: rp7 commentedsubscribe
Edit: sorry, forgot about the new Follow button
Comment #15
rp7 CreditAttribution: rp7 commentednvm
Comment #17
firebird CreditAttribution: firebird commentedLahode: Looks like the bots didn't grab your latest patches for testing. Maybe a file naming issue?
Comment #18
firebird CreditAttribution: firebird commentedOr is it that no-one remembered to set the status to "needs review"?
Comment #20
firebird CreditAttribution: firebird commentedComment #22
firebird CreditAttribution: firebird commentedComment #24
firebird CreditAttribution: firebird commentedComment #25
dstolTagging 'Needs tests'
Comment #26
johnvI am anxious to test this, but havent done it - was busy with the other issues..
Comment #27
dstolTests as in http://drupal.org/simpletest-tutorial-drupal7
Comment #28
Summit CreditAttribution: Summit commentedHi, Will this be committed please? They are much wanted features and patches #24 is working.
Greetings, Martijn
Comment #29
lahode CreditAttribution: lahode commentedHi, I tested #24 and works fine. Don't use #6 it was the first test
Comment #30
Summit CreditAttribution: Summit commentedHi, Patch #24 is working, that the options arise. I hoped I got the possibility to have a menu on which:
1) I am able to set say the first two levels expanded:
1) When I click on a above level, the underneath levels are getting expanded:
But I can't get this to work.. Could you help with this please?
Thanks a lot in advance!
Greetings, Martijn
Comment #31
johnvHi Martijn,
auto-expanding seems to be a problem with core.
Check for "Auto expand" in the core issue queue,
There are also some module regarding "Menu trail"
Comment #32
Summit CreditAttribution: Summit commentedHi,
@Johnv Did you solve this? I tried Taxonomy_menu_trail but it wouldn;t work...
Thanks a lot in advance!
Greetings, Martijn
Comment #33
johnvNo, I just set my menu to 'Expanded'...
Comment #34
dstolThis still needs tests but I committed it to 7.x-1.x. Check out the attached patch for what I committed, since it's a little different. http://drupalcode.org/project/taxonomy_menu.git/commit/09e7d88
Comment #35
firebird CreditAttribution: firebird commentedThe hash in the filename breaks the URL. Try this:
http://drupal.org/files/sync-menu-1192084-%2334.patch
Comment #36
dstol#1350338: The Taxonomy Menu rebuild process encountered an error.
7.x-1.x is broken at the moment.
Comment #37
firebird CreditAttribution: firebird commentedThis patch should fix it.
Comment #38
kiwimind CreditAttribution: kiwimind commentedI have applied the patch at #37 manually and it works fine.
I'm not sure whether to drop this in here, or whether it's even doable, but is it possible to have the menu item display order mirror the taxonomy listing order?
Edit: Further to this, they do obey the weights as given in the taxonomy list when the taxonomy menu is rebuilt, but not when reordering them in the taxonomy terms list.
Comment #39
ali_b CreditAttribution: ali_b commentedpatch in #37 works
Comment #40
Summit CreditAttribution: Summit commentedHi, Patch in #37 works, please commit, because the latest .dev version is not working now.
Thanks in advance,
greetings, Martijn
Comment #41
mrfelton CreditAttribution: mrfelton commented#37 works for me. Thanks.
Comment #42
m0dHi!
I patched 7.x-1.x version with #37, but it looks like the "Add all linked nodes to each terms" feature isn't there anymore. Did I do it right? How can I have that feature? I find it very important.
Thanks!
Comment #43
jeffschulerIt looks like the
show_nodes
option (the "Add all linked nodes to each terms" feature) was removed between the patches in #6 and #12, and never made it into the commit (in #34.)@lahode: was this intentional?
Comment #44
lahode CreditAttribution: lahode commentedHi,
Yes it was.
First I was looking for a way to display all the nodes as children of each terms. But then, I first found that my coding was not working not working so well and that it wasn't a great idea to mix the concept of taxonomy and nodes into the same menu, so I finally decided to use views.
I leave it to you to decide whether this feature is interesting or not and if yes, maybe to adapt it to #37
By the way I didn't test last dev, did Dstol add the patch to the release?
Comment #45
jeffschuler@lahode: Thanks for your response. I figured as much, considering that [the now abandond] Taxonomy Treemenu module requires >200kb of code to accomplish this. You put views underneath taxonomy menu terms? Contrib modules or custom implementation?
Yes, dstol committed the patch to 7.x-1.x-dev. See #34. (#37 is a fix post-commit.)
Comment #46
lahode CreditAttribution: lahode commentedNo, I wasn't clear.
In fact I simply display the nodes related with a View when the term is selected, no relation with this module.
However I wonder why you would need 200kb of code to add this option? In fact to find all nodes to a term is very easy, see:
@@ -517,7 +544,38 @@ function taxonomy_menu_handler($op, $args = array(), $node = NULL, $item = array
in patch #6.Then the only thing to do is to manage when creating, updating or deleting a node the modification in the tree with a ook_node_insert($node), hook_node_update($node) and hook_node_delete($node). Regenerating the tree each time would be a 1 line option, while it might be a bit dirty and slow the entire Drupal.
As far as I use this module today, it is nothing more with the latest dev + #37 as mentioned
Comment #47
kingandy CreditAttribution: kingandy commentedPatch works, though the perfectionist in me wants to replace
with
The
return $temp->term_count
on the next line functions exactly the same, and it's a line less of code ...Comment #48
patoshi CreditAttribution: patoshi commentedim getting this:
screenshot: http://prntscr.com/4btca
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /batch?id=22&op=do StatusText: OK ResponseText: Fatal error:
Using D7.9 and comes up after i link a taxo to a menu.
Comment #49
dstolI just committed #37, with the tweak from #47 and I removed a notice that it would be throwing otherwise.
http://drupalcode.org/project/taxonomy_menu.git/commitdiff/632adcd
Please test.
Comment #50
dstolBack to fixed.
Comment #52
hmartens CreditAttribution: hmartens commentedI noted this comment at discussion(http://drupal.org/documentation/modules/taxonomy_menu#comment-5563868) as well (sorry)...
I used the "7.x-1.2" version on Drupal 7.12 but it doesn't give me the options for expand menu etc. So I installed the "7.x-1.x-dev" version that gives me the options but still doesn't help me at all. There's no difference whether I use "Auto expand menu items" or not...and the "Add item for vocabulary" is great out, I can't select this option... and I can't add anything in "Custom name for vocabulary item"...
Maybe I'm missing something because I can't get it displaying right...I want a menu item called "Category" which is my taxonomy term and then when I press that it drops down a menu with all the terms listed under Category...
Please help..and thank you :)
Comment #53
jeffschulerhmartens: see #45 here. The ability to list nodes in the menu was initially part of the patch here, but was removed and has not been added to this module.
Comment #54
hmartens CreditAttribution: hmartens commentedaah shucks! So I'm a bit screwed then :) Thanks for replying though
Comment #55
dubcanada CreditAttribution: dubcanada commentedI don't know why this was closed considering only half of what was positioned has been added.
Comment #56
hles CreditAttribution: hles commentedIf we are going to commit new features in 7.x-2.x, we are going to need tests shipped with them. Maybe it would help to create 3 separate issues, one for each feature.
Comment #57
firebird CreditAttribution: firebird commentedSo, to get this into 7.x-2.x, we'd need to add the functionality from #34 and #37, and add tests for them, right?
Comment #58
hles CreditAttribution: hles commentedAlways with tests yes. Maybe we should be careful not to add any feature, just the ones that are common use cases, else I worry we will have a very bloated admin interface. But that's up to discussion.
Comment #59
firebird CreditAttribution: firebird commentedAh. but 1) from the original post has already been implemented in 7.x.-2x. I didn't realize that. That's actually the one that I need, so I'll leave 2) and 3) to someone else.
Comment #60
hles CreditAttribution: hles commentedEven 2) is implemented as well in 2.x as far as I understand what it means. I'll change the title to focus on 3) only, although I'm not really keen in adding this feature.
Comment #61
johnvThis thread is getting very long and complex. It contains 3 issues, of which 2 are fixed.
let's close this thread, and open a follow-up here: #2004266: Display all nodes related to each term in the menu