I’m upgrading my Craft2 blog to Craft3 at https://brill.blog. I’ve got a loop to display text, images, and block quotes from a Matrix field, that follows this pattern:
{% for block in entry.matrixContent %}
{% if block.type == "imageBlock" %}
<img src="{{ image.getUrl(transform) }}" alt="{{ image.title }}" />
{% elseif block.type == "textBlock" %}
{{ block.text | smartypants | replace({' ' : ' '}) | raw }}
{% endif %}
{% endfor %}
The actual code has lots more 'elseif's for image rows, block quotes etc. This all works fine in Craft2.
For Craft3, I’ve added .all() to the first line. But the result is that the only image blocks get rendered correctly, and everything else is missing.
Is there anything obvious I should be looking for?
I’d be happy to post much more code, if anyone here is willing to look through it.
Thanks in anticipation.
devMode
switched on and it'll show you any error messages