3

I came across an interesting issue. I'm using Craft CMS 3.0.0-RC14 and non of my image paths are showing but the title and the file name does.

{% set image = nav.navLogo.one() %}
{{image.title}} // works
{{image.fileName}} // works
{{image.getUrl()}} // no output, not even error

Any ideas ?

  • 2
    Did you enable the assets for this source have public URLs in your volume settings in the cp? – Robin Schambach Mar 10 '18 at 14:35
7

The solution is to enable "assets for this source have public URLs" in the volume settings.

1

I'd like to add to this post another possible solution if your "Assets for this source have public URLs" is turned on, but images are still not showing. I had my wires crossed in how I have the Base URL of the overall site set in relation to the Base URL in the Assets volume. In my particular case, the following settings finally got things working and all the images show up with getUrl() as they should. Hopefully this is helpful to others banging their heads trying to figure this out!

In Assets/Volume: Base URL = /images File System Path = /images

In Settings/Sites: Base URL = @web/

  • The use of @web in your sites is being discouraged – Jan May 13 '19 at 7:01

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.