0

'Comments', 'Users', 'Taxonomy' are Entity Types because they each define their own sets of required fields.

I am having a discussion with my boss where I am arguing that 'Menu' are really just a type of 'Taxonomy'. This is because Taxonomy has a parent field, and a title, but Menu also shares this, and extends it to require a 'link' field. He, however, disagrees with me and says that there are things which Menus can do that Taxonomy cannot. But I don't see what.

  1. 'Menu' has the concept of hierarchy, so does 'Taxonomy'.
  2. 'Menu' has a 'link' field to link to a Node, or an external link. But this can also be done using 'Taxonomy', by manually adding in a 'link' field manually.
  3. You can control permissions on 'Menu' items, you can also do this with Taxonomy

I understand that a 'Menu' serves a special and common need, but conceptually I think it's just a type / superset of taxonomy, not another Entity. I think this chain of thought is common, as reflected by the number of sites that uses the Taxonomy Menu module.

In a previous question, I grok that Comments and Nodes are different Entities because they have completely different fields. But here, Menu seems to have the same fields as Taxonomy - namely parent and title.

So, why has the Drupal community decided that Menu need to be its own Entity Type, instead of a being just a module that extends taxonomy? (i.e. Taxonomy Menu) What does Menu offer that you cannot achieve in Taxonomy?

1
  • Don’t conflate the two. Taxonomy gives context and meaning, a menu provides navigation and content hierarchy. Entities in a menu tree don’t mean they’re related, but taxonomy defines and grants those relationships.
    – Kevin
    Jun 12 '18 at 23:17
2

Basic difference I run into some time ago: a menu can link to only one content where taxonomy term can refer to several nodes. So, if you need a relationship node -> term that allows one node to be marked with many terms (and, in consequence, have one term assigned to many nodes) then menus won't do that for you (at least not out of the box). Node -> menu relationship is more 1-to-1 where node -> term is 1-to-many.

1
  • Yes I totally agree. You just showed something that taxonomy can do which menu cannot. This is the reason why I ask my question - what can menu do that taxonomies cannot?
    – dayuloli
    Mar 5 '15 at 18:06
1

Menus:

  • provide an "active path" class to help style the menu tree
  • have built-in support for multilevel menu functionality
  • provide Breadcrumb information (for some breadcrumb implementations)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.