The attached patch adds a hook to _taxonomy_menu_trails_get_path(). This allows other modules to provide any kind of mapping for terms of a given id.
Example use cases:
- You have a view of all nodes of a given term id And want to keep the menu trail to that view.
- You have a node with an explicit list of other nodes, which all have the same trail.
- Whatever :)