Made the if less restrictive, to allow for panels and user profile and load taxonomy on the node if $op is not view but load.
On panels, it is necessary to include the "node-content" pane, so Node Breadcrumb has a node to work with.
function node_breadcrumb_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
if (($op == 'view' || $op == 'load') and ($node->nid == arg(1) or $page or $node->type == 'profile') and $node->type <> 'panel') //hacktheback panels breaks $page
{
if (!$node->taxonomy) {
$taxonomy=module_invoke("taxonomy","nodeapi",$node,'load');
$node->taxonomy=$taxonomy['taxonomy'];
$node->taxonomy=taxonomy_node_get_terms($node);
}
$db_rules = db_query("select * from {node_breadcrumb_rule} order by weight, rid");
while ($rule = db_fetch_object($db_rules)) {
// check node type
if ($rule->node_type != '' && $node->type != $rule->node_type) continue;
// check terms
foreach (array($rule->tid1, $rule->tid2) as $tid) {
if ($tid > 0) {
if (empty($node->taxonomy[$tid]))
{
continue 2;
}
}
elseif ($tid < 0) {
foreach ($node->taxonomy as $term) {
if ($term->vid == -$tid)
{
continue 2;
}
}
continue 2;
}
}
// check php condition
if ($rule->condition != '') {
eval("\$condition=$rule->condition;");
if (!$condition) {
continue;
}
}
// apply menu location
_node_breadcrumb_set_location($rule->mid, "node/$node->nid", $node->title);
break;
}
module_invoke_all("node_breadcrumb", $node);
}
}
Regards,
Lukas
Comments
Comment #1
ndf commentedThanks, this patch works with panels 6.x-3.9