Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have some node pages being rendered by Panels. I'd like a Custom Breadcrumb for the Panel to include some Tokens from the current node being viewed, and can't get it working yet.
Even showing something like this, [node:nid]
, doesn't seem to work. Maybe with Panels, these Tokens aren't available? I honestly don't know.
Comment | File | Size | Author |
---|---|---|---|
#16 | cb_panel_fix-1276952-12.patch | 2.43 KB | tripper54 |
#4 | cb_panel_fix_1276952.diff | 2.23 KB | MGN |
Comments
Comment #1
minneapolisdan CreditAttribution: minneapolisdan commentedAnybody done this before?
Comment #2
minneapolisdan CreditAttribution: minneapolisdan commentedDoes my question not make sense? Or this just an unpopular topic? :)
Comment #3
MGN CreditAttribution: MGN commentedThis was working in 6.x-2.x. It sounds like custom breadcrumbs is not getting a node context from the panel. Have you assigned a context for the panel (one of the many panel configurations)?
Comment #4
MGN CreditAttribution: MGN commentedI've identified a number of changes in panels that might account for this. Can you try this patch and see if it fixes the problem?
Comment #5
pepejose CreditAttribution: pepejose commentedhi,
I applied this patch but nothing changes, still no token content.
I use panel page node with argument nid and respective context but then in custom breacrumbs, token values are empty.
thanks, sorry for my poor english.
EDIT: It works if taxonomy term reference fielf has only one value
Comment #6
ownage CreditAttribution: ownage commentedI think I'm having the same problem using taxonomy with panels. I'm also using this dev.
It can't find the taxonomy term reference field used in one of the content panes in my panels variants.
Format example:
Cadet Store
[node:field-uc-product-type1]
[current-page:title]
URL: http://gmsaa.org/store/classic_flight_jacket
Taxonomy Term: [node:field-uc-product-type1] (this should output Apparel & Fabrics)
But instead outputs:
Home » Cadet Store » Classic Flight Jacket
It works in Views, so I don't know why it isn't working in Panels.
Comment #7
bjalford CreditAttribution: bjalford commentedSaw this: http://drupal.org/project/panels_breadcrumbs
not sure if it helps or not?!
Comment #8
minneapolisdan CreditAttribution: minneapolisdan commentedI have been using the Panels Breadcrumbs modules now, and it seems to work well.
Comment #9
acidpotato CreditAttribution: acidpotato commentedFacing the same problem, node tokens don't showup on Panel Node page. I tried with [node:nid] and many other node tokens but none of them appear on the Panel Node Page. Therefore changing the status of the issue. If this has been fixed in 7.x-2.x-dev please feel free to close this issue.
Comment #10
tanickl CreditAttribution: tanickl commented#4: Thank you for the patch. It worked for my use case. I can now use node tokens on node pages being rendered using panels.
Comment #11
acidpotato CreditAttribution: acidpotato commentedHi tanickl, may I ask what Panels version you are using? I am using 7.x-3.2 and after applying patch to CB 7.x-2.x-dev I can't get node fields to appear as crumbs on Node Panel Page.. what secret sauce did you use?
In the admin/config/user-interface/custom-breadcrumbs do I have to select certain boxes? Also whats your hierarchy of CB weights? I have the Panels the heaviest weight still no dice.
Comment #12
morbiD CreditAttribution: morbiD commentedThe posts above are unclear as to whether they are trying to use custom breadcrumbs on Panel Nodes or Node Templates, the difference being that a Panel Node is a specific Panel with a path, while a Node Template is a Panel that overrides the display of all nodes that match the selection criteria.
The patch doesn't seem to make tokens work for Node Templates. I assume tanickl is using Panel Nodes.
I did a bit of poking around in the code and as far as I can tell, the
if ($page) { ... }
block incustom_breadcrumbs_panels_ctools_render_alter()
returns out of the function before it ever gets to the block dealing with Node Templates, so the node context is never passed on.Adding the following lines after
$objs = array('panel' => $info);
seems to pass on the node context and make the tokens work:I guess the function needs a bit of a rewrite though, since the Node Template code is apparently never evaluated.
Comment #13
elyobo CreditAttribution: elyobo commented-morbiD-'s changes work fine for me.
Comment #14
elyobo CreditAttribution: elyobo commentedUnfortunately upgrading to the dev version breaks all the normal breadcrumbs (drupal error, no idea what due to https://bugs.php.net/bug.php?id=61045)...
Comment #15
elyobo CreditAttribution: elyobo commentedFixed other issues; everything working fine for me at the moment. The dev version is well ahead of the stable, is there any time frame for the next release?
Comment #16
tripper54 CreditAttribution: tripper54 commentedmorbiD's changes in #12 worked for me, thanks.
Here's a patch incorporating #4 and #12
Comment #17
Nikro CreditAttribution: Nikro commented#16 tripper54 patch seems to be good.
I'm just not sure of loading all the nodes from all the panes is the thing we want to use (patch #4).
It would be nice if panels would offer more token support, I would put it here but it's definitely related to the panels module.
Would be nice to use any context from within the panel.
Comment #18
colanCommitted in 1783356.
Comment #19.0
(not verified) CreditAttribution: commentedclarifying