Image displays alt text - image itself not visible


I have a problem with dispalying an image. Image is in the same folder as file.
The code in the header of is:

title: ‘some title’
cache_enable: false
header: ‘some header’
text: ‘some text’
image: wykres.png
header: ‘anotherheader’
text: ‘another text’
image: wykres.png

And this is code from my modular template file features.html.twig:

    {{ content }}
    <div class="feature-items">
    {% for feature in page.header.features %}
           <div class="feature">
            {% if feature.icon %}
            <i class="fa fa-fw fa-{{ feature.icon }}"></i>
            <div class="feature-content icon-offset">
            {% else %}
            <div class="feature-content">
            {% endif %}
            {% if feature.header %}
            <h4>{{ feature.header }}</h4>
            {% endif %}
            {% if feature.text %}
            <p>{{ feature.text }}</p>
            {% endif %}
            {% if feature.image %}
            <img src="{{ feature.image }}" alt="" width="100" height="100">
            {% endif %}
    {% endfor %}

and as a result I get only alt text instead of image, what might be a problem?


You could dump feature.image to see if you get the correct path.

{{ dump( feature.image ) }}

@AmauryH this command gives me null, but anyway thank you, I managed to display images with:
{% if feature.image %} <img src="{{[feature.image].url }}" alt=""> {% endif %}

Hey @AmauryH I’ve found the same thing, dump doesn’t output anything for me. I’ve had much better luck with print_r so something like this might work for you:

  {{ feature.image|print_r }}

Notice: for dump you have to activate the debug bar.