In Drupal 7, while attempting to specify the "File directory" option as "fields/field_foo/[node:nid]" in an image field configuration, the form does not validate. The error text is: "The File directory is using the following invalid tokens: [node:nid]".

As per File (Field) Paths, core does not support node tokens for this. This is a feature request to get this into core. It will greatly help folks keep their "files" directory clean.

Also see ImageField Tokens.


Deciphered’s picture

I'm happy to lend a hand with issue, but it's worth noting that the reason that Node (or Entity) tokens don't work by default is that they aren't necessarily known until after the Node (or Entity) has been saved, which is why File (Field) Paths does the processing after the Node (or Entity) has been saved.

Andrew_Mallis’s picture


Andrew_Mallis’s picture

Issue summary: View changes

Added link to second contrib project.

catch’s picture

Version: 9.x-dev » 8.1.x-dev
Issue summary: View changes
Status: Active » Closed (duplicate)
Issue tags: +Needs issue summary update