If the 'Item for Vocabulary' option is disabled, then menu items are created in the root of the menu.
I can move them to the right place, but if future terms are added, there is a maintenance problem, as someone with menu access needs to go back and put the new term menu items in the right place.

This problem would be avoided if the options for the taxonomy menu had a setting for the parent menu item to place items into.

Comments

indytechcook’s picture

This problem would be avoided if the options for the taxonomy menu had a setting for the parent menu item to place items into.

This will be added to V3 as the concepts of 'menu groups' is introduced. Menu groups will allow for more customizations to what group of terms will display where in the menu. She this post for more details: #388486: Basic considerations for latest version

I want to make sure we don't have a bug also here. If you add a new child term to a parent term then it would retain the same place in the hierarchy.

Vocab:
term1
term2
-term2.1
-term2.2
term3

You add the vocabulary then move term like so

Menu:
menu item
menu item
-term1
-term2
--term2.1
--term2.2
-term3

If you add term term 2.1.1 then the menu should be:
menu item
menu item
-term1
-term2
--term2.1
---term2.1.1
--term2.2
-term3

Please confirm that this is your situation. You are adding a term4 which is making this menu?:

menu item
menu item
-term1
-term2
--term2.1
---term2.1.1
--term2.2
-term3
term4

If so, then I see your pain. Adding it to the current version makes sense.

joachim’s picture

Yes, I think we're talking about the same thing:

I want this structure
- existing menu item
- existing menu item (set as parent for this module's items)
-- term 1
-- term 2
--- term 2.1
-- term 3
- existing menu item

When site admins create a new term, say either term 4 or term 2.2, we should get this:
- existing menu item
- existing menu item (set as parent for this module's items)
-- term 1
-- term 2
--- term 2.1
--- term 2.2
-- term 3
-- term 4
- existing menu item

With the current version, the extra terms just appear as top-level items at the end of the menu.

I need to get this working for a client, so expect a patch shortly :)

indytechcook’s picture

A patch would be great! One note is that term 2.2 should be placed in the correct spot already. Is it not?

joachim’s picture

StatusFileSize
new3.98 KB

Here's a patch on the CVS 6-2 branch.
I'm replacing the menu selection with a single drop-down to pick menu and location -- the same as when you edit a regular menu item.
There's an extra variable that stores the parent.
The change in logic code is in _taxonomy_menu_save(), which considers the parent term and vocabulary menu item first, before falling back to the set variable (in the existing version, this case gives us a 0, and hence the new menu item is created at the root level).

indytechcook’s picture

Status: Active » Needs review

Wow. That was quick :)

joachim’s picture

Yup, term 2.2 gets placed correctly in the current version, sorry!

indytechcook’s picture

This has been added to the newest DEV

Christopher Herberte’s picture

What happened to this? does not seem to be available in DEV..
EXACTLY what I'm looking for.

indytechcook’s picture

It was backed out of DEV because it caused other issues which made it to stable. It needs to be tested more before I commit again. Go ahead and apply the patch and test it out. I won't have time until this weekend.

http://drupal.org/node/60108

joachim’s picture

It works great for me on my production site, but as that other issue showed, there's a problem coming from an earlier version. So kind of upgrade path might be needed to change the settings?

jax’s picture

The patch fails on the latest dev, would it be possible to reroll it please.

joachim’s picture

StatusFileSize
new3.64 KB

Rerolled on latest 6--2 branch.

jax’s picture

Ah, I just did it myself as well. Seems to work fine, but haven't tested all the options. That's why we should write tests.

joachim’s picture

Yup -- it seems it causes this problem: http://drupal.org/node/411136
but I'm a bit baffled as my patch doesn't change how the path is made...

indytechcook’s picture

Path is a little complicated. I tried to do my best to describe it here http://drupal.org/node/380652 under the hook_taxonomy_menu_path section.

Please continue to test this. It's a great feature. I'm trying to spend time on V3 and menu groups. This feature will also be part of V3.

moonray’s picture

subscribe

moonray’s picture

Tested the patch.
Never needed to vocabulary summary menu item, so didn't test or care about that part.
The rest works great.

bitsantos’s picture

Tried the patch too against 6.x-2.4-beta1 and I'm not experiencing any problems so far. Subscribing to this thread just in case.

indytechcook’s picture

@bitsantos

did you have the "item for vocabulary"

Anonymous’s picture

Title: add an option for the menu item under which to place taxonomy items » Add taxonomy items to any menu
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new3.7 KB

Updated patch to work with latest dev version.

Tested - seems to be working well!

indytechcook’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.