1

I have a project with the following code:

{% if entry.filmPoster | length %}
    <img src="{{ entry.filmPoster.first().getUrl('filmPoster') }}" alt="">
{% elseif entry.locale('en_gb').filmPoster | length %}{# fall back to English if there is one #}
    <img src="{{ entry.locale('en_gb').filmPoster.first().getUrl('filmPoster') }}" alt="">
{% endif %}

filmPoster is an Asset field, and it is translatable. It's set to restrict uploads to a single folder, and the upload location is [whats on] {slug}

In the back end, I go to an Entry and upload an asset in this field in English, save, switch to Welsh, upload the Welsh version of the asset and save. In both cases, in the CMS, I can switch between languages for the entry and see the correct image asset in each locale. If I then look on the server, I can see the correct files have been saved in the appropriate file-path:

/content/whats-on/entry-title/image-name.jpg
/content/whats-on/entry-title-in-welsh/image-name-welsh.jpg

On the front end template, however, the image for the Welsh version is a 404 broken image.

However, if I remove the transform from the equation, the correct image loads...

{% if entry.filmPoster | length %}
    <img src="{{ entry.filmPoster.first().getUrl() }}" alt="">
{% elseif entry.locale('en_gb').filmPoster | length %}{# fall back to English if there is one #}
    <img src="{{ entry.locale('en_gb').filmPoster.first().getUrl() }}" alt="">
{% endif %}

Why is attempting to use a transform breaking? What have I got wrong?

All I see in the logs is:

2016/10/13 09:39:03 [warning] [application] [Forced] Image “entry-title-in-welsh/image-name-welsh.jpg” cannot be found

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.