0

How to setup file directory where the images are saved to use tokens based on node author ? I have all setup with current user, but this is not good if moderator or admin needs to make a change with content made by user.

Strange is that for automatic node title i can use node author tokens, but not for image field.

1

Have a look at this issue that explains why you cannot use node tokens in Views: https://www.drupal.org/node/1788414

This 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.

The File (Field) Paths module provides this functionality:

The File (Field) Paths module extends the default functionality of Drupal's core File module, Image module and many other File upload modules, by adding the ability to use entity based tokens in destination paths and file names.

In simple terms, File (Field) Paths allows you to automatically sort and rename your uploaded files using token based replacement patterns to maintain a nice clean filesystem.

That should allow you to use the node:author token.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.