<p>On your screenshot of the block type powitanie you see two fields: <code>powitanieNaglowek</code> and <code>powitanieTresc</code>. Yet, in your code you try to use </p>

<pre><code>  &lt;h2&gt;{{ block.naglowekPowitanie }}&lt;/h2&gt;
</code></pre>

<p>The error simply says: in the block type you are using there is no field called <code>naglowekPowitanie</code>.</p>

<p>Changing that H2 to </p>

<pre><code>  &lt;h2&gt;{{ block.powitanieNaglowek }}&lt;/h2&gt;
</code></pre>

<p>should do the trick.</p>

CC BY-SA 3.0
2017-02-05T15:31:06.677Z
2017-02-05T15:31:06.677Z
Jan_dh
<p>I just playing first time with Matrix and can't figure whats wrong with this code, here's error code:</p>

<pre><code>Craft\MatrixBlockModel and its behaviors do not have a method or closure named "naglowekPowitanie".
</code></pre>

<p>Matrix field config:
<a href="https://i.sstatic.net/muClf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/muClf.png" alt="config"></a></p>

<pre><code>{% for block in entry.homepage %}
        {% if block.type == "powitanie" %}
            &lt;article id="main"&gt;

                &lt;header class="special container"&gt;
                    &lt;span class="icon fa-truck"&gt;&lt;/span&gt;
                    &lt;h2&gt;{{ block.naglowekPowitanie }}&lt;/h2&gt;
                    &lt;p&gt;{{ block.trescPowitanie }}&lt;/p&gt;
                &lt;/header&gt;

        {% elseif block.type == "wstep" %}
                    &lt;section class="wrapper style2 container special-alt"&gt;
                        &lt;div class="row 50%"&gt;
                            &lt;div class="8u 12u(narrower)"&gt;

                                &lt;header&gt;
                                    &lt;h2&gt;{{ block.wstepNaglowek }}&lt;/h2&gt;
                                &lt;/header&gt;
                                &lt;p&gt;{{ block.wstepTresc }}&lt;/p&gt;
                                &lt;footer&gt;
                                    &lt;ul class="buttons"&gt;
                                        &lt;li&gt;&lt;a href="#" class="button"&gt;{{ block.wstepPrzycisk }}&lt;/a&gt;&lt;/li&gt;
                                    &lt;/ul&gt;
                                &lt;/footer&gt;
        {% endif %}
{% endfor %}
</code></pre>

<templating><matrix>
Getting error: "Matrix do not have a method or closure named..."
# Getting error: "Matrix do not have a method or closure named..."

(Asked by: username_0 on 2017-02-05)

I just playing first time with Matrix and can't figure whats wrong with this code, here's error code:
Craft\MatrixBlockModel and its behaviors do not have a method or closure named "naglowekPowitanie".

Matrix field config:

{% for block in entry.homepage %}
        {% if block.type == "powitanie" %}
            

                
                    
                    {{ block.naglowekPowitanie }}
                    {{ block.trescPowitanie }}
                

        {% elseif block.type == "wstep" %}
                    
                        
                            

                                
                                    {{ block.wstepNaglowek }}
                                
                                {{ block.wstepTresc }}
                                
                                    
                                        {{ block.wstepPrzycisk }}
                                    
                                
        {% endif %}
{% endfor %}

**Tags:** templating, matrix


---

## 1 answers

### Answer by username_1 on 2017-02-05. Score: 2

On your screenshot of the block type powitanie you see two fields: powitanieNaglowek and powitanieTresc. Yet, in your code you try to use 
  {{ block.naglowekPowitanie }}

The error simply says: in the block type you are using there is no field called naglowekPowitanie.
Changing that H2 to 
  {{ block.powitanieNaglowek }}

should do the trick.


---

