I'm a newcomer to Craft from the far-off lands of WordPress. I hope my stay is long and fruitful, but at the moment that prospect is in danger. The problem I'm having must be embarrassingly simple, but I can't find my way through it.
The simple task I am attempting to accomplish it to display an image I uploaded to an entry via a new asset field.
If there is a method or practice for displaying an image via asset fields found on the internet, I have tried it. Currently, this is how I am trying to render the image in my twig file:
{% for image in entry.featuredImage %}
<img src="{{ image.url }}" alt="blah">
{% endfor %}
No image shows up.
When I dump(image)
, should it be returning an array with 666 lines? I understand an asset returns a kind of Asset File Model (although I don't entirely understand what that means), but I find it hard to believe it's supposed to be that large.
Hoping to find at least the url of the asset, I perform dump(image.url)
, but it only returns bool(false)
. Why would it be doing that?
I created my uploads
directory, and setup my asset source. I've tried doing this on an entirely fresh, up-to-date and clean install, but it still behaves the same way.
What am I missing or doing wrong?
Thank you!