This module could implement its own invisible field which could be assigned to entities like taxonomy terms or nodes. That field would show up in the entity edit form and provide some settings like enable/disable and maybe something like a weight value. That would then allow additional things like:
- If the field was assigned to taxonomy terms, then individual terms from the tree could be excluded from the menu tree automatically, even if the menu was re-created over and over again.
- If the field was assigned to nodes of a certain type, then those nodes could be included into the menu tree automatically as menu item children of the taxonomy term they are associated with. The detailed field settings would then allow the editors to manage, which of those nodes and in which order (by the weight) would be included into the menu.
The use case that created that idea is a mega drop down menu which is derived from a product group taxonomy, but only certain components of the whole content should be included into the menu.
What do you think? It could be implemented completely optinal, so that current functionality would not be broken.
Comment | File | Size | Author |
---|---|---|---|
#5 | taxonomy_menu_2463795.patch | 6.77 KB | dtamajon |
Comments
Comment #1
dtamajon CreditAttribution: dtamajon commentedI have added a check in term to decide if term should be shown in the menu, so every time it is rebuild the terms will be shown only if they are marked.
Comment #2
jurgenhaasThanks @dtamajon for getting back to this suggestion. I've looked into the implementation and have a couple of suggestions:
Comment #3
dtamajon CreditAttribution: dtamajon commentedHi @jurgenhaas, I have done a try to use fields... so I suppose the logic place to add the "display" field is the "taxonomy_menu" table.
As configuration is by term, it means that I can't save info while taxonomy menu is not defined.
So for one side I think that taxonomy term should be configured independently of taxonomy menu. I haven't tested, but if menu is changed, I guess the "taxonomy_menu" table is rebuilt, not updated, which means that terms configuration is losen (of course, we can take care of holding values and create the correct data).
The other option, is hiding "Display term in Taxonomy Menu" field in terms if no menu is selected for the taxonomy. It means if I don't want a taxonomy for a time in a menu and then I activated later again I will haver to configure every term again.
I'm not sure which path makes more sense on a general solution, so let me know you opinion.
Comment #4
jurgenhaasLike I wrote in the original issue description I would prefer to have that field in either the taxonomy_term entity and/or assigned to nodes (or generally any displayable entity). Is there a problem with that?
Comment #5
dtamajon CreditAttribution: dtamajon commentedPlease, let me know if this patch applies as you expected.
Comment #6
dtamajon CreditAttribution: dtamajon commentedHi @jurgenhaas,
Will this feature be merged in the taxonomy menu? If not, I will try to create a new project.
Comment #7
jurgenhaas@dtamajon sorry for delaying this, totally my fault. I'm currently so busy with customer work and I have no active project where this is been used. So if you feel comfortable with it, please go ahead and don't wait for me, if you don't mind.