I noticed that menu trails were not working on my site today and after some digging in the code I found that the following lines mean that, where a trail has been set for a taxonomy which matches a node type, the taxonomy will override the node.
This was a problem for me because I hadn't - as far as I could tell through the UI - set anything for taxonomy, so ALL my node type settings were being overridden.
To fix it, I changed this code (menutrails.module, line 123 onwards) - note the change in the last line:
function menutrails_node_location($node) {
// This should only fire if the menu isn't already active.
$item = menu_get_item();
if (db_result(db_query("SELECT count(mlid) FROM {menu_links} WHERE link_path = '%s' AND module = 'menu'", $item['href'])) == 0) {
$type_trails = variable_get('menutrails_node_types', array());
$href = $type_trails[$node->type] ? $type_trails[$node->type] : FALSE;
$term_trails = variable_get('menutrails_terms', array());
if (!empty($node->taxonomy)) {
... to this code:
function menutrails_node_location($node) {
// This should only fire if the menu isn't already active.
$item = menu_get_item();
if (db_result(db_query("SELECT count(mlid) FROM {menu_links} WHERE link_path = '%s' AND module = 'menu'", $item['href'])) == 0) {
$type_trails = variable_get('menutrails_node_types', array());
$href = $type_trails[$node->type] ? $type_trails[$node->type] : FALSE;
$term_trails = variable_get('menutrails_terms', array());
if (!empty($node->taxonomy) && !$href) {
I hope this helps rather than hinders, as this is a great module (but can be a bit of a git to tweak ;o).
Best wishes,
Al
p.s. I'm really not much of a coder at all, so apologies for my lack of finesse :o)
Comments
Comment #1
sunAs of now, this happens by design. Taxonomy trails override node type trails.
Comment #2
rkahlert commentedHi, I have this problem as well, but with free tags, which I can't set in the menu trails settings. I am using the latest dev-version.