You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the eleventy-image webc component to render the images for a collection of posts. I am looping through posts and trying to pass {{ post.data.image }} as the src for the image, but I can't get it to work. Code looks like this:
{% for post in posts %}
...
{% renderTemplate "webc" %}
<eleventy-image:src="post.data.image" alt="alt text"></eleventy-image>
{% endrenderTemplate %}
...
{% endfor %}
I tried :src={{ post.data.image }}, src={{ post.data.image }} but nothing seems to work. I also tried switching to shortcodes, but again I am not able to pass the src dynamically from the template data. What am I doing wrong here?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to use the eleventy-image webc component to render the images for a collection of posts. I am looping through posts and trying to pass {{ post.data.image }} as the src for the image, but I can't get it to work. Code looks like this:
I tried
:src={{ post.data.image }}
,src={{ post.data.image }}
but nothing seems to work. I also tried switching to shortcodes, but again I am not able to pass the src dynamically from the template data. What am I doing wrong here?Beta Was this translation helpful? Give feedback.
All reactions