<p>I’m upgrading my Craft2 blog to Craft3 at <a href="https://brill.blog" rel="nofollow noreferrer">https://brill.blog</a>. 
I’ve got a loop to display text, images, and block quotes from a Matrix field, that follows this pattern:</p>

<pre><code>{% for block in entry.matrixContent %}

    {% if block.type == "imageBlock" %}
        &lt;img src="{{ image.getUrl(transform) }}" alt="{{ image.title }}" /&gt;

    {% elseif block.type == "textBlock" %}
        {{ block.text | smartypants | replace({'&amp;nbsp;' : ' '}) | raw }}

    {% endif %}

{% endfor %}
</code></pre>

<p>The actual code has lots more 'elseif's for image rows, block quotes etc. This all works fine in Craft2.</p>

<p>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. </p>

<p>Is there anything obvious I should be looking for?</p>

<p>I’d be happy to post much more code, if anyone here is willing to look through it. </p>

<p>Thanks in anticipation. </p>

CC BY-SA 4.0
2019-11-29T13:06:44.163Z
Have you tried it without changing the code? It'll still run - though it will have some deprecation message about using .all() instead of "old" looping, but if the problem lies therein, then should be the easiest way to find out.
Campiotti
CC BY-SA 4.0
2019-11-24T11:29:52.753Z
Be sure to have `devMode` switched on and it'll show you any error messages
James Smith
CC BY-SA 4.0
2019-11-26T15:16:03.873Z
It's definitely in dev mode. Craft3 version has same code as Craft2, but only displays the imageBlocks, omits everything else. Very weird!
Brian Liddell
<matrix>
Missing Matrix content after upgrading from Craft2 to Craft3
# Missing Matrix content after upgrading from Craft2 to Craft3

(Asked by: username_0 on 2019-11-22)

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" %}
        

    {% 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.

**Tags:** matrix

> **Comments:**
> **username_2**: Be sure to have `devMode` switched on and it'll show you any error messages  
> **username_0**: It's definitely in dev mode. Craft3 version has same code as Craft2, but only displays the imageBlocks, omits everything else. Very weird!  
> **username_1**: Have you tried it without changing the code? It'll still run - though it will have some deprecation message about using .all() instead of "old" looping, but if the problem lies therein, then should be the easiest way to find out.  

---

## 0 answers

