0

I have a file on S3 uploaded with Assets. The full URL is:

http://s3-us-west-2.amazonaws.com/my-bucket/source-folder/subfolder/file-name.pdf

source-folder is the subfolder in the bucket where the Assets directory is set.

I want to output this path:

source-folder/subfolder/file-name.pdf

{my_assets_field:server_path} gets me /subfolder/file-name.pdf, but I can't find any way in the Assets field tag to dynamically output the source folder.

1

As of version 2.1, you have to hard-code the source folder:

source-folder/{assets_field:server_path}

However, a solution for this is in active development for version 2.2.

| improve this answer | |
  • {subfolder} only gives me the path after the source folder. So {subfolder}/{filename} gives me subfolder/file-name.pdf. I should emphasize that by "source folder", I'm referring to the folder set in Assets > External Sources > Subfolder. – kmgdev Aug 23 '13 at 15:21
  • 1
    Got it. In that case it’s not possible without just hardcoding it. I just went ahead and put it on the 2.2 list, which is in active development. – Brandon Kelly Aug 23 '13 at 18:57
  • Cool. Thanks, B. If you update your answer about hardcoding, I'll accept it. – kmgdev Aug 23 '13 at 22:43

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.