1

I have setup insert module to upload images in a body field. I want to set the path for the "FILE DIRECTORY" to the "node id" token but it does not show in the avaliable tokens.

The image field looks like enter image description here

Browse avaliable tokens looks like enter image description here

Why isn't the nid token available?

4
  • Which nid are you looking for - the one for the image file or the one for the page you are trying to create?
    – schnippy
    Aug 17, 2013 at 16:23
  • The one for the page that the image is used on. - I Tried content-type/[site:current-page:nid] . But doesn't work
    – sasdev
    Aug 17, 2013 at 16:26
  • where is the above token dialogue coming from? and you are trying to control the path that the image gets uploaded to, not the path gets output in the display, correct?
    – schnippy
    Aug 17, 2013 at 17:05
  • The tokens come from the link below the helper text. Yes i want to set the upload path
    – sasdev
    Aug 17, 2013 at 17:16

1 Answer 1

3

You want to use the filefields_path module to add node tokens to your imagefield (or any other file fields):

The File (Field) Paths module extends the default functionality of Drupal's core Upload module, the FileField module and many other File Upload modules by adding the ability to use node tokens in destination paths and filenames.

In my test environment with the insert module and this module enabled, I now have the capacity to use node:nid in the filefield path as well as a number of other useful tokens:

enter image description here

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.