I have read (or tried to) http://drupal.org/node/691078. I'm using token 7.x-1.0-beta6 which shuld have basic field token support.
I'm trying to use some of this tokens using token filter.
From my test global tokens seem supported. For example [site:name] is replaced correctly.
Unfortunately [node:title] doesn't work as well as [node:nid].
Any idea?
Anything to do with missing context as stated here http://drupal.org/node/1270160?
Thank you
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | token-filter-1321410-9.patch | 504 bytes | clemens.tolboom |
Comments
Comment #1
dave reidWhat kind of field are you trying to use [node:title]? A field on that node? A block?
Comment #2
dave reidAlso try using 7.x-1.x-dev.
Comment #3
dimon00 commentedI believe the problem is in panel module.
The token [node:title] is replaced correctly in a node with panels disabled.
On a node template where panels are enabled it dosn't work. :(
Comment #4
dave reidI think at one point that Panels in its code used unset($node->title) which of course means that the node title is then unavailable to anything that wants to use it after that happens. But I think this might have been fixed in the latest version of Panels/CTools.
Comment #5
dimon00 commentedI don't think that's the problem.
I tried even with: [node:url], [node:url:path] and other tokens (even token corrisponding to my custom cck field).
The substitution doesn't happen when panels are enabled.
Comment #6
Letharion commentedDoes the Panel configuration use "Node content", or "Node body" in the variant? Using individual fields is a common integration problem with other modules that depend on Core's node_build_content call.
Comment #7
dimon00 commentedIt does use node content. Any workaround?
Comment #8
dave reidPlease try the latest version: 7.x-1.x-dev. I think #1438810: expand token guessing to views fixed this issue. If not, re-open this.
Comment #9
algazaras commentedI am using the latest version: 7.x-1.x-dev but I can't use any node related token in a panel pane. is there any other thing I should take into account?
Comment #10
clemens.tolboomAttached patch adds support for panels node view pages by adding
I've tested this with the fieldable_panel_panes and tokens.
XRef #1768550: Use context keywords in fieldable panels
Comment #11
clemens.tolboomSee #1775160: Add $user to the available tokens for ie [user:name]
Comment #12
dave reidHow exactly are you using tokens in a panel panes/content? I need specifically what use cases and where to reproduce.
Comment #13
clemens.tolboomI'm not sure whether my solution is that good anymore. My current use case was solved by creating a mini panel to have a reusable widget for my title.
But this issue summary and comment #3 suggested panels + tokens was in err so I ended up in trying to get my panels node view title into a reusable solution by using fieldable_panels_panes. That suggested to use token_filter to display context tokens #1768550: Use context keywords in fieldable panels.
But when using fieldable_panels_panes which is an entity I cannot display anything from the current node as token_filter does not know it or did I miss again the available global tokens?
In #1768550-9: Use context keywords in fieldable panels I asked for whether panels contexts should be available for token module.
Steps to reproduc are:
- install fieldable_panels_panes
- visit http://drupal.d7/admin/structure/fieldable-panels-panes
- Add a new Panel pane
- Save and manage fields
-- Add a text field with input filter enabled
- visit http://drupal.d7/admin/structure/fieldable-panels-panes/view/1/edit
-- add tokens [current-user:name] [site:name] [node:title] [current-node:title] to text field
- visit http://drupal.d7/admin/config/content/formats/full_html
-- enable 'Replace tokens'
- visit http://drupal.d7/admin/structure/panels and enable node template
-- add a variant
-- add the fieldable-panels-pane to the panels content.
- visit a node
-- The tokens are partly replaced.
-- I expected the node related tokens being replaced too.
(did this help)
Comment #14
AgentJay commentedI applied the patch from #10 and I have to say it is awesome, and should be committed. So simple, and exactly what I needed.
Comment #15
bgronek commentedI have applied this patch (#10) as well and it closes a huge gap in panels enabling new development scenarios. What still needs to be done to get this patch committed and included in a stable release? I'm happy to help, so feel free to give me a ping.
Comment #16
dave reidI don't think this would work if you had more than one node context being used in your Panel, as this would *only* work for the first node. I'm wary of adding this due to the fact that based on the description, you *should* be able to use %node:title natively in Panels. But if Panels/Page Manager doesn't have that solved correctly, I'm not sure how we reliably can.
Comment #17
darvanenI think I'll wait to see how #2075663: Improve context logic for filter processing. goes and whether it fixes this issue.
Comment #18
dubs commented+1 for that patch. It works for me, but agreed this could be tricky if there are more nodes. The context comes over from the path argument though, so I'm not sure that would be an issue.
Comment #19
darvanenNo activity for many years and Drupal 7 is now out of support. Marking out of date.