I have two media types:

Document (main)

  • Name
  • DocID
  • Description
  • Year
  • Main file (file reference field)
  • Supplemental files (optional, multi-value media reference field)

Document (supplemental)

  • Name
  • Description
  • File (file reference field)

I would like all files to be saved in public://docs/year/docid/filename

Tokens make this perfectly simple with the main file, but when saving the supplemental file(s), I need the year and docid values from the parent entity. I was thinking of trying a custom token, but I have no idea if it's possible to retrieve the field values from the parent, given that it hasn't even been saved yet.

Is this even possible?

Your Answer

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

Browse other questions tagged or ask your own question.