Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-05T15:31:06.677Z
Answers.LastActivityDate: 2017-02-05T15:31:06.677Z
Answers.UserDisplayName: Jan_dh
Body: <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>
  
Tags: <templating><matrix>
Title: Getting error: "Matrix do not have a method or closure named..."
ThreadText: # 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:
  [![config](https://i.sstatic.net/muClf.png)](https://i.sstatic.net/muClf.png)
  
  ```
  {% for block in entry.homepage %}
          {% if block.type == "powitanie" %}
              <article id="main">
  
                  <header class="special container">
                      <span class="icon fa-truck"></span>
                      <h2>{{ block.naglowekPowitanie }}</h2>
                      <p>{{ block.trescPowitanie }}</p>
                  </header>
  
          {% elseif block.type == "wstep" %}
                      <section class="wrapper style2 container special-alt">
                          <div class="row 50%">
                              <div class="8u 12u(narrower)">
  
                                  <header>
                                      <h2>{{ block.wstepNaglowek }}</h2>
                                  </header>
                                  <p>{{ block.wstepTresc }}</p>
                                  <footer>
                                      <ul class="buttons">
                                          <li><a href="#" class="button">{{ block.wstepPrzycisk }}</a></li>
                                      </ul>
                                  </footer>
          {% 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
  
  ```
    <h2>{{ block.naglowekPowitanie }}</h2>
  
  ```
  
  The error simply says: in the block type you are using there is no field called `naglowekPowitanie`.
  
  Changing that H2 to
  
  ```
    <h2>{{ block.powitanieNaglowek }}</h2>
  
  ```
  
  should do the trick.
  
  
  ---
  
  