Answers.Body: <p>It seems like you want to set offset to false after your first section.</p>
  
  <p>To do this correctly you would need to use set like this:</p>
  
  <pre><code>{% set offset = false %}
  </code></pre>
  
  <p><a href="http://twig.sensiolabs.org/doc/tags/set.html" rel="nofollow">Checkout the documentation to set a variable</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-06T13:04:27.460Z
Answers.LastActivityDate: 2016-04-06T13:04:27.460Z
Answers.UserDisplayName: Marco Schuler
Answers.Body: <p>The problem line is this one:</p>
  
  <pre><code>{% offset = true %}
  </code></pre>
  
  <p>It needs to be:</p>
  
  <pre><code>{% set offset = true %}
  </code></pre>
  
  <p>I think there are a couple of occurrences.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-06T14:22:47.687Z
Answers.Text: Sorry, I've just realised that the answer above says the same thing. Mark his as the correct answer if you agree.
Answers.UserDisplayName: Jamie Pittock
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-06T14:34:07.340Z
Answers.Text: Thanks, yes there were two occurrences thank you
Answers.UserDisplayName: Ross
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-06T14:13:15.513Z
Answers.LastActivityDate: 2016-04-06T14:13:15.513Z
Answers.UserDisplayName: Jamie Pittock
Body: <p>Sorry if this is a really obvious question, I'm new to Twig and Craft. I'm getting the following error: 
  Unexpected tag name "offset" (expecting closing tag for the "if" tag defined near line 54)</p>
  
  <p>Can anyone tell me what is wrong with my code?</p>
  
  <pre><code>&lt;div class="box alt container"&gt;
  {% set offset = true %}
  {% if offset %}
  &lt;section class="feature left"&gt;
      {% set caseHero = entry.heroImage.first() %}
      &lt;a href="#" class="image icon fa-signal"&gt;&lt;img src='{{caseHero.url}}' alt="" /&gt;&lt;/a&gt;
      &lt;div class="content"&gt;
          &lt;h3&gt;{{entry.title}}&lt;/h3&gt;
          &lt;p&gt;{{entry.description}}&lt;/p&gt;
      &lt;/div&gt;
  &lt;/section&gt;
      {% offset = false %}
  {% else %}
  &lt;section class="feature left"&gt;
      {% set caseHero = entry.heroImage.first() %}
      &lt;a href="#" class="image icon fa-signal"&gt;&lt;img src='{{caseHero.url}}' alt="" /&gt;&lt;/a&gt;
      &lt;div class="content"&gt;
          &lt;h3&gt;{{entry.title}}&lt;/h3&gt;
          &lt;p&gt;{{entry.description}}&lt;/p&gt;
      &lt;/div&gt;
  &lt;/section&gt;
      {% offset = true %}
  {% endif %}
  </code></pre>
  
  <p></p>
  
Tags: <templating>
Title: Twig Templating If statement (Unexpected tag name error)
ThreadText: # Twig Templating If statement (Unexpected tag name error)
  
  (Asked by: username_0 on 2016-04-06)
  
  Sorry if this is a really obvious question, I'm new to Twig and Craft. I'm getting the following error:
  Unexpected tag name "offset" (expecting closing tag for the "if" tag defined near line 54)
  
  Can anyone tell me what is wrong with my code?
  
  ```
  <div class="box alt container">
  {% set offset = true %}
  {% if offset %}
  <section class="feature left">
      {% set caseHero = entry.heroImage.first() %}
      <a href="#" class="image icon fa-signal"><img src='{{caseHero.url}}' alt="" /></a>
      <div class="content">
          <h3>{{entry.title}}</h3>
          <p>{{entry.description}}</p>
      </div>
  </section>
      {% offset = false %}
  {% else %}
  <section class="feature left">
      {% set caseHero = entry.heroImage.first() %}
      <a href="#" class="image icon fa-signal"><img src='{{caseHero.url}}' alt="" /></a>
      <div class="content">
          <h3>{{entry.title}}</h3>
          <p>{{entry.description}}</p>
      </div>
  </section>
      {% offset = true %}
  {% endif %}
  
  ```
  
  **Tags:** templating
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-04-06. Score: 2 | Accepted answer
  
  It seems like you want to set offset to false after your first section.
  
  To do this correctly you would need to use set like this:
  
  ```
  {% set offset = false %}
  
  ```
  
  [Checkout the documentation to set a variable](http://twig.sensiolabs.org/doc/tags/set.html)
  
  
  ---
  
  ### Answer by username_2 on 2016-04-06. Score: 1
  
  The problem line is this one:
  
  ```
  {% offset = true %}
  
  ```
  
  It needs to be:
  
  ```
  {% set offset = true %}
  
  ```
  
  I think there are a couple of occurrences.
  
  > **Comments:**
  > **username_2**: Sorry, I've just realised that the answer above says the same thing. Mark his as the correct answer if you agree.  
  > **username_0**: Thanks, yes there were two occurrences thank you  
  
  ---
  
  