I have a node type called Inventory; it's a monster. Lots of cck fields and taxonomy terms. I have several views in the secondary menu and I would like to create a back link to them from the node; based on the top taxonomy term. The top level views are mutually exclusive, thus a one to one relationship.
Example Breadcrumb
Home >> Top Level View On Menu, Displaying Top Term >> Node
or even this
Home >> Top Level View On Menu, Displaying Top Term
when viewing a node inside of inventory.
So far I have a Triggered Rule called Breadcrumbs.
Event: Content is going to be viewed.
Condition: Node has type -> Inventory
Actions: Set Breadcrumb
Titles:
Test A
Test B
Paths:
park-models
park-models/new
So when I go to view a node that has a path park-models/new/chariot-eagle-west-e-109 which is made via these tokens [field_type-term]/[field_condition-term]/[title-raw] all I get in the breadcrumbs is Home. What am I doing wrong?
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | breadcrumbs.JPG | 138.89 KB | andersonmh |
| #11 | rules.panels2-hack.inc_.zip | 1.07 KB | muka |
Comments
Comment #1
amitaibuI think you are not using the token's prefix. Look at the token replacement list - every token has a 'prefix' which is the argument it is taken from.
Comment #2
mikeytown2 commentedRight now tokens are only used for auto Path/Title generation.
If I change it to this
Titles:
[node:title]
Paths:
node/[node:nid]
Still no go.
Comment #3
mikeytown2 commentedBeen testing and the problem involves Panels. If you override the node with panels, breadcrumbs via rules doesn't work. Breadcrumbs do work with panels if you use Menu Breadcrumb, and have a menu set for each item.
Steps to have panels take over nodes
Enable Panel pages
Page Title: %node
Path: node/%
Arguments: Add Node ID
Is this a wait and see, or do I need to ditch panels to get Breadcrumbs set by rules working?
Comment #4
amitaibuI think panels has it's own implementation of breadcrumbs, so it might be overriding your breadcrumbs.
Two things that come into mind are:
1) Check if there's an option in panels to disable it's breadcrumbs.
2) Try making the Rules module weight (in the {system} table) heavier.
Comment #5
mikeytown2 commentedOpened an issue in Panels
http://drupal.org/node/364280
Took a peek at Menu Breadcrumbs, since it works.
Here's the code in system.rules.inc
Looks like menu_breadcrumb_init() always get's called, thats why it grabs the breadcrumb
$breadcrumb = drupal_get_breadcrumb();So no matter what, it re saves the breadcrumb. What if Rules had a similar hook for the breadcrumb, to get around issues like this one?Comment #6
fagohm, what's the difference here? Does panels overwrite the breadcrumb?
I don't think there is a bug in rules, but if you can determine a more robust way to set breadcrumb, go for it!
Comment #7
mikeytown2 commentedPanels doesn't invoke the NodeAPI if your only using CCK fields. Panels sets up a pseudo node when using node/%.
Rules could benefit if it used hook_init() instead of hook_nodeapi(), thus it would work on any page; not just nodes.
Comment #8
fagoyou can do so by using the according event from System, A page is being viewed or so,
Comment #9
mikeytown2 commented@fago
Sweet, Thanks!!!
Comment #11
muka commentedSorry, this issue is closed.. but someone solved with node/% breadcrumb issue ?
If I use the system "A page is viewed" I got as unavailable Content has type ( Unavailable argument: Content )
so tried with php condition
but token replacement for node doesn't work, so php again (i want url as prodotti/taxonomy_t/node_name in breadcrumb)
TITLES:
Prodotti
PATHS:
prodotti
Is this the right approach?
Attached a file with some functions I've worte, useful to display the panels path in breadcrumb with custom functions trought the php of Rules. More info in the file.
Thanks.
ps oops. the attachment need the < ?php opening tag at the first line.
Comment #12
andersonmh commented+1 or subscribe, however the protocol is used. I have a similar situation that I foolishly sent to the Rules discussion group. As @muka described, I have the same issue: If I use the system "A page is viewed" I got as unavailable Content has type ( Unavailable argument: Content ). My original post:
http://groups.drupal.org/node/19615
Why can't I get "Content Type = "what ever"?