<p>According to Pixel &amp; Tonic Support it is a known issue, submit the problem to PT Support to let them know it is a problem.</p>

CC BY-SA 3.0
2015-02-18T08:52:34.633Z
Ah ok thanks, where did you find it as a known issue please? And what is the best place to submit the problem? support.pixelandtonic.com? Thanks!
Mike Vaux
CC BY-SA 3.0
2015-02-18T12:51:58.947Z
I submitted a support request from the Craft Dashboard regarding this issue mid December and got this reply: `Thanks for sending that in. It's a known issue, but a bit of a complicated one, unfortunately, so we haven't found a way to fix it yet.` I guess both the Craft Dashboard and support.pixelandtonic.com submits tickets to the same system, so either would be fine.
Alf Vestre
CC BY-SA 3.0
2015-02-16T20:58:46.673Z
2015-02-16T21:00:12.577Z
2015-02-16T21:00:12.577Z
Alf Vestre
<p>It's definitely a bug in live preview but looks like you can work around it.</p>

<p>This doesn't appear documented at all—so be careful—but you can use <code>.status()</code> to get the block's status. It looks like an IF block is enough to get a matrix block to refresh the live preview.</p>

<pre><code>{%for block in entry.matrixBlock %}
   {% if ( block.type == 'supertable' and block.status == 'enabled') %}
  {#do whatever #}
   {%endif %}
{%endfor %}
</code></pre>

<p>I found out about .status out awhile back messing around trying to figure out if there was a good way to display a "sold out" status for a particular show date (for example):</p>

<pre><code>{%for thedate in entry.showDates.type('date').status() %}

    {% if thedate.status() == 'disabled' %}
        &lt;strike&gt;{{thedate.showDate|date('m/d/y')}}&lt;/strike&gt; SOLD OUT! 
    {% else %}
        {{thedate.showDate|date('m/d/y')}}
    {%endif%}&lt;br&gt;

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

CC BY-SA 3.0
2015-02-17T05:52:41.970Z
2015-02-17T06:33:27.207Z
2015-02-17T06:33:27.207Z
RitterKnight
<p>I have a template which loops through Matrix Blocks. The site itself correctly ignores any Blocks which are 'disabled', but on viewing the page in the Live Preview, those Blocks are visible. A key part of the reason for using Craft as the CMS for this site was the draw of the Live Preview, so this is important for us to get right.</p>

<p>I can't see anything as part of a <a href="http://buildwithcraft.com/docs/templating/matrixblockmodel" rel="nofollow">Matrix Block Model</a> which would indicate an assigned status to each Block which I could access. If there was, as there is with a straight entry, I could at least do some sort of a work around e.g. forcing the collation of Blocks to only those with a particular status of 'enabled'.</p>

<p>This feels like it might just be a bug; I am seeing other complications with this particular Live Preview, for instance if any offset or limit is given to the Blocks, rearranging the blocks in the Live Preview has no effect either.</p>

<p>If anyone could shed some light / offer some advice that would be much appreciated!</p>

<matrix><live-preview>
Is it possible to prevent disabled Matrix Blocks showing in a Live Preview?
# Is it possible to prevent disabled Matrix Blocks showing in a Live Preview?

(Asked by: username_0 on 2015-02-16)

I have a template which loops through Matrix Blocks. The site itself correctly ignores any Blocks which are 'disabled', but on viewing the page in the Live Preview, those Blocks are visible. A key part of the reason for using Craft as the CMS for this site was the draw of the Live Preview, so this is important for us to get right.

I can't see anything as part of a [Matrix Block Model](http://buildwithcraft.com/docs/templating/matrixblockmodel) which would indicate an assigned status to each Block which I could access. If there was, as there is with a straight entry, I could at least do some sort of a work around e.g. forcing the collation of Blocks to only those with a particular status of 'enabled'.

This feels like it might just be a bug; I am seeing other complications with this particular Live Preview, for instance if any offset or limit is given to the Blocks, rearranging the blocks in the Live Preview has no effect either.

If anyone could shed some light / offer some advice that would be much appreciated!

**Tags:** matrix, live-preview

---

## 2 answers

### Answer by username_2 on 2015-02-17. Score: 5 | Accepted answer

It's definitely a bug in live preview but looks like you can work around it.
This doesn't appear documented at all—so be careful—but you can use .status() to get the block's status. It looks like an IF block is enough to get a matrix block to refresh the live preview.
{%for block in entry.matrixBlock %}
   {% if ( block.type == 'supertable' and block.status == 'enabled') %}
  {#do whatever #}
   {%endif %}
{%endfor %}

I found out about .status out awhile back messing around trying to figure out if there was a good way to display a "sold out" status for a particular show date (for example):
{%for thedate in entry.showDates.type('date').status() %}

    {% if thedate.status() == 'disabled' %}
        {{thedate.showDate|date('m/d/y')}} SOLD OUT! 
    {% else %}
        {{thedate.showDate|date('m/d/y')}}
    {%endif%}

{%endfor%}


---

### Answer by username_1 on 2015-02-16. Score: 1

According to Pixel & Tonic Support it is a known issue, submit the problem to PT Support to let them know it is a problem.

> **Comments:**
> **username_0**: Ah ok thanks, where did you find it as a known issue please? And what is the best place to submit the problem? support.pixelandtonic.com? Thanks!  
> **username_1**: I submitted a support request from the Craft Dashboard regarding this issue mid December and got this reply: `Thanks for sending that in. It's a known issue, but a bit of a complicated one, unfortunately, so we haven't found a way to fix it yet.` I guess both the Craft Dashboard and support.pixelandtonic.com submits tickets to the same system, so either would be fine.  

---

