1

I can load the s3 image fine using the s3 base path and the craft cms filename that is saved in the craft cms database:

<img src="{{cdnUrl}}/filepath/{{entry.Image.first().filename }}" />
renders
<img src="cdn.imageurl.com/filepath/filename.jpg" />

However if I want to access the same image without the s3 base path (e.g. in order to use an image transform), I get a null.

<img src="{{entry.Image.first().getUrl('transform')}}" />
renders
<img src="" />

Any help would be appreciated!

  • Does it work if you call getUrl() without the transform argument? – Stephen Lewis May 20 '17 at 16:10
1

Turns out you need to have the URL prefix set under the Asset Settings in order to call .getUrl() enter image description here

Once I added this, my transforms began working.

| improve this answer | |
  • Be sure to configure the protocol correctly as well. https:// http:// or // – joshwa May 22 '17 at 19:16

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.