Answers.Body: <p>It looks like you're missing a closing <code>{% endcache %}</code> tag towards the end of your template.</p>
  
  <p>(See <a href="https://docs.craftcms.com/v3/dev/tags/cache.html" rel="nofollow noreferrer">https://docs.craftcms.com/v3/dev/tags/cache.html</a>)</p>
  
  <p>You might also be missing a closing <code>{% endminify %}</code> tag too, but I'm not sure if you've posted the whole of your template or not.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-05T10:42:42.910Z
Answers.LastActivityDate: 2020-04-05T10:42:42.910Z
Answers.UserDisplayName: James Greig
Answers.Body: <p>it looks like you started with a given set of templates, maybe from some kind of example craft template site. 
  while this is always great for learning the details, it can make things difficult being new to craft/twig because this error belongs to the minify-plugin which "only" serves optimization. you should start the other way around and start with some sort of a blank canvas so to speak and add things… like an include, a loop, image loop, randomization, etc.</p>
  
  <p>that way it's easier to keep focus and you won't get distracted by things or functions or in this case a plugin, which isn't necessary for the basics.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-06T18:59:13.957Z
Answers.LastActivityDate: 2020-04-06T18:59:13.957Z
Answers.UserDisplayName: Matthias
Body: <p>I am getting the following Twig error and I cannot figure out what is wrong. I'm new to Twig.</p>
  
  <pre><code>Twig Syntax Error – Twig\Error\SyntaxError
  
  Unexpected "minify" tag (expecting closing tag for the "cache" tag defined near line 5).
  
  in /var/www/craft/templates/index.twig at line 5
  
  {% extends "_layouts/_layout.twig" %}
  
  {% import "_partials/_macros.twig" as macros %}
  
  {% block content %}
  
  {% cache using key "home-page" %}{%- minify -%}
  
  {% set banner = entry.homeBanner.one() %}
  
  &lt;div class="home-banner"&gt;
  
    &lt;img class="home-banner__image js-object-fit"
  
   src="{{banner.image[0].getUrl('homePageBanner')}}"/&gt;
  
    &lt;div class="home-banner__container container"&gt;
  
      &lt;div class="row justify-content-center"&gt;
  
        &lt;div class="col-10 col-md-8"&gt;
  
          &lt;h1 class="h1 home-banner__heading"&gt;{{banner.heading}}&lt;/h1&gt;
  
        &lt;/div&gt;
  
        {% set bannerBtn = banner.button.one() %}
  ``
  </code></pre>
  
Tags: <templating><craft3>
Title: Need help with a Twig template error
ThreadText: # Need help with a Twig template error
  
  (Asked by: username_0 on 2020-04-05)
  
  I am getting the following Twig error and I cannot figure out what is wrong. I'm new to Twig.
  
  ```
  Twig Syntax Error – Twig\Error\SyntaxError
  
  Unexpected "minify" tag (expecting closing tag for the "cache" tag defined near line 5).
  
  in /var/www/craft/templates/index.twig at line 5
  
  {% extends "_layouts/_layout.twig" %}
  
  {% import "_partials/_macros.twig" as macros %}
  
  {% block content %}
  
  {% cache using key "home-page" %}{%- minify -%}
  
  {% set banner = entry.homeBanner.one() %}
  
  <div class="home-banner">
  
    <img class="home-banner__image js-object-fit"
  
   src="{{banner.image[0].getUrl('homePageBanner')}}"/>
  
    <div class="home-banner__container container">
  
      <div class="row justify-content-center">
  
        <div class="col-10 col-md-8">
  
          <h1 class="h1 home-banner__heading">{{banner.heading}}</h1>
  
        </div>
  
        {% set bannerBtn = banner.button.one() %}
  ``
  
  ```
  
  **Tags:** templating, craft3
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-04-05. Score: 2
  
  It looks like you're missing a closing `{% endcache %}` tag towards the end of your template.
  
  (See <https://docs.craftcms.com/v3/dev/tags/cache.html>)
  
  You might also be missing a closing `{% endminify %}` tag too, but I'm not sure if you've posted the whole of your template or not.
  
  
  ---
  
  ### Answer by username_2 on 2020-04-06. Score: 1
  
  it looks like you started with a given set of templates, maybe from some kind of example craft template site.
  while this is always great for learning the details, it can make things difficult being new to craft/twig because this error belongs to the minify-plugin which "only" serves optimization. you should start the other way around and start with some sort of a blank canvas so to speak and add things… like an include, a loop, image loop, randomization, etc.
  
  that way it's easier to keep focus and you won't get distracted by things or functions or in this case a plugin, which isn't necessary for the basics.
  
  
  ---
  
  