### Summary

Complexities in Adim come about through two main issues. These issues are intrinsic to website menu systems, not Taxonomy Treemenu or Drupal specific,

1. If a menu contains links to standard Drupal terms and nodes, Taxonomy Treemenu is not summoned. See custom URLs for more information.
2. If a menu is built on a multiple hierarchy, then the menu system will not know what to do with the ambiguous links. See multiple hierarchy ambiguity for more information.

These issues affect,

- backtracking breadcrumbs on paged menus.
- breadcrumbs in multiple hierarchies.
- templating of menus.
- structuring term lists to reflect the structure of the menu.

They can be resolved by,

- Ignoring them and the functionality.
- Using hooks and preprocessors. This is a very CPU expensive operation, so not implemented in Treemenu, but a coder can implement using provided functions.
- Using state saving methods. Treemenu avoids these solutions as not generalized.
- Using modified URLs. Solves all of the above, at the expense of duplicating path aliasing.

### An overview of considerations for taxonomy menus

This summary applies to all menu systems which display taxonomy type information. We will mainly refer to the issues by using Drupal terms, such as 'node', or 'term'. Where appropriate, we have added information about solutions offered by Taxonomy Treemenu.

When Taxonomy Treemenu is set to default, the links in the menus offer stock Drupal paths, i.e. 'taxonomy/term/%' and 'node/%'. If a user clicks on a link, they go to one of these URLS. Taxonomy Treemenu is not called. Read more about invoking Taxonomy Treemenu.

The second consideration is that there is an ambiguity when using multiple hierarchies. The organisation of the taxonomy must be somewhat 'flattened' to display a treemnu, and this results in multiple links for a single node. Read more about multiple hierarchy ambiguity.

due to these issues, some functions are difficult to provide,

- breadcrumbs On a paged menu, treemenu cannot backtrack if the module is never invoked. Within a multiple hierarchial taxonomy menu, a single node may refer to several links. In blocks or on pages, the menu system will not know which link to provide for a breadcrumb.
- menu expansion Menu expanding menus are not currently enabled in treemenu, but the code is there. When displaying multiple heirarchies, expanding menus can not expand if the target is ambiguous.
- Term list structure. It is desirable, in some situations, for any paged lists of nodes to reflect the structure of the menu they were summoned from. A menu system can't provide this information if it is never invoked.

Note that these issues may not apply to many sites. Sites may choose not to navigate by breadcrumb, for example, or enforce a single hierarchy. If the primary site navigation is not by treemenus, there is no need for term lists to reflect the menu. However, there are sites which will wish to implement such functionality, and many large sites have custom menu systems to do that.

### How to invoke treemenu?

First, there are Drupal hooks and preprocessors.

- hook_menu_link_alter() will give any module the chance to alter a link,
- hook_preprocess_page() will do the same for pages.

But hooks for rendering are slow, as they are called for every link or page on site. Hooks and preprocessors are appropriate for adding small pieces of information, but not the large changes suggested by Taxonomy Treemnu. Also, a hook does not answer the question, 'How does the menu system know this is a treemenu link?'. We are considering building parts of the API, and adding instuctions, so users can make use of some functions if they wish.

Second, there are treemenu specific URLs. These will always invoke treemenu 'on demand' and at the appropriate time. However, they produce multiple paths to terms and nodes, which can multiply site aliases. Read more about custom urls.

### How to pass information to a menu system

The first way is to carry the information either in the server (sessions) or at the client (cookies) end. For many security, programming, and philosphical reasons treemenu will not take that approach. Sorry.

Which leaves the URL as the main source of information, so Taonomy Treemenu provides altered URLs. As mentioned elsewhere, this can multiply site aliases.