Node's tokens (Tokens related to individual content items, or "nodes".) are not present in field settings.
This is a problem for example if one want to specify a image path that depend of node:id. Or a default image alt that is the same that the node title.
Comments
Comment #1
Golem07 commentedJust a short update - not sure if this is significant in any way:
When I install File (Field) Paths module the node tokens do reappear for file fields (only) but disappear right away again after disabling the module.
Update: adding the very same field to e.g. profile2 type makes it appear as a token too under "current user" tokens. There just seems to be no way for me to make a field available as a node token.
Comment #2
dynamicdan commentedI don't see any node tokens when editing a an 'image' (File/image) field.
I'm not sure if this is simply a lack of token support from the node or image modules.
I want to use [node:source:source:author:uid] (or perhaps [node:author:uid]) as part of the save path for files. This would help me nicely group uploads by user id.
Comment #3
jtassin commentedI have come across this issue as well when trying to setup a trigger for comments. Trying to send a email using [node:author:mail] and it won't resolve at all. Logs say: invalid email [node:author:mail]
Comment #4
dynamicdan commentedLets see if we can get some attention here.
Comment #5
zmove commentedSubscribe. I can't find any token related to the node author on an image field for example (to define path). It's weird to have a so small issue queue as this kind of need seems very common to me.
Comment #6
dave reidThis is a limitation of Drupal core - it does not provide any node context for token replacement aside from the global tokens that are available. You will need a module like http://drupal.org/project/filefield_paths in order to use node tokens in the file upload directory tokens.
You need to use tokens like [comment:node:author:mail]. An action for comments has a comment context only, not a node context.
Comment #7
dave reidFor Meta tags, make sure you upgrade to the latest release of Token. The 7.x-1.3 version contained a bug that made token contexts disappear in the modal dialog.
Comment #8
dynamicdan commentedThere is a test in drupal core to support node:author so I don't see how drupal core is limited. Are you saying this test should also be present in the file.test ?
node.test:2303
Comment #9
gagarine commentedThis is still present in D8.
Comment #10
gagarine commentedComment #11
gagarine commentedComment #12
gagarine commentedComment #13
sassafrass commentedI am using D8.3.5 and trying to enter tokens in the link URL field. Although the node tokens are available, they are interpreted literally. For example, /node/[node:nid] or [node:url:path], result in /node/[node:nid] or /[node:url:path] respectively. As opposed to the expected /node/1 or /my-alias.
Comment #14
berdirThis should have been left closed years ago.
As explained above, you can not use tokens everywhere and whoever calls token replace needs to provide the necessary context.
@sassafrass: If you haven't found a solution for what you are trying to do, I'd suggest asking on Drupal Answers or another support channel, you can not use tokens in links, that's just not possible.
Comment #16
rgnyldz commentedFor those who stumble on this there is a path token where we could get the node id under Current page > URL > Unaliased URL > Arguments
[current-page:url:unaliased:args:1]