I'm having an issue where I am getting template errors related to my craft cache tags in some environments but not others. I have my site set up on a production server that is a Linode/Forge setup. The site works fine there.
Locally I am using a Homestead/Vagrant setup and I am getting template errors on any pages that use the cache tag.
Here's the code that is having the error:
{% extends "_layout" %}
{% block pageStyles %}
{% for entry in craft.entries.section('juices') %}
.color-nameplate.btn-{{entry.slug}} {
background-color: {{entry.productColorCode}};
}
{% endfor %}
{% endblock %}
{% block bodyClass %}home-page{% endblock %}
{% block content %}
{% cache if craft.config.cache %}
{% for row in entry.bodyBuilder.level(1) %}
{% include 'bodyblocks/' ~ row.type.handle with {row: row} %}
{% endfor %}
{% endcache %}
{% endblock %}
This code works in the production environment but not on local. On local it is showing the following template error:
Unexpected token "name" of value "craft" ("end of statement block" expected).
If I remove the cache tags then the template displays, but this won't work for my production environment so I need to work out what the issue is.
Thanks,
Brian