Image displays alt text - image itself not visible

Hi,

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

title: ‘some title’
cache_enable: false
features:
-
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 %}
            </div>
        </div>
    {% endfor %}
    </div>
</div>

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

Hello,

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="{{ page.media[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:

<pre>
  {{ feature.image|print_r }}
</pre>

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