<p>Got to the bottom of it!</p>

<p>The _entry template relies on the fact there's a template error.</p>

<p>On the production site I'd added,</p>

<pre><code>'suppressTemplateErrors' =&gt; true
</code></pre>

<p>to the config, which stopped the behaviour that was being relied upon to serve the generic template</p>

CC BY-SA 3.0
2017-10-24T14:59:41.763Z
2017-10-24T14:59:41.763Z
foamcow
<p>I have a Structure named "pages" which is set to use the template named "_entry".</p>

<p>When trying to visit one of the pages I’m just getting a blank screen. </p>

<p>The Craft log shows an error in the template loader because it can’t find a template.</p>

<blockquote>
  <p>Craft\TemplateLoaderException: Unable to find the template
  "about/index". in
  /path/to/site/craft/app/etc/templating/twigextensions/TemplateLoader.php:123</p>
</blockquote>

<p>The structure is set to use the template named <code>_entry</code> which is present and all as it should be.</p>

<p>I have tried renaming the template to no avail. </p>

<p>Other parts of the site are working fine. It only seems to be this Structure that has a problem.</p>

<p>The problem is occurring on an Azure VM running Ubuntu 16.04 LTS with PHP 7.0, running MySQL 5.7 with Strict mode disabled and managed with ServerPilot. I'm pretty sure it's been working OK since I deployed to Azure a couple of days ago but I can't explicitly remember testing these pages since my involvement has largely been on a different part of the site (which is working OK).</p>

<p>This is working fine locally, and has been working fine on a test server set up at Digital Ocean (I've decommissioned that but I'm in the process of setting it up again to test this).</p>

<p>Update: I can confirm the same code works perfectly on the Digital Ocean/ServerPilot combo so it appears to be something Azure or possibly MySQL 5.7 related (the Azure deployment is using MySQL 5.7 with Strict mode disabled)</p>

<p>Update: I'd incorrectly read the error message. The _entry template appears to be found. But this is then trying to load another template (in this case about/index) which is where things fail. 
There is no about/index template it should fall through to a generic template.</p>

<pre><code>{% if craft.request.getSegment(2) %}
    {% set internal = craft.request.getSegment(1) ~ '/' ~ craft.request.getSegment(2) %}
    {% set index = craft.request.getSegment(1) ~ '/index' %}
{% else %}
    {% set internal = entry.uri ~ '/index' %}
    {% set index = entry.uri ~ '/index' %}
{% endif %}

{% include [internal, index, '_generic'] ignore missing %}
</code></pre>

<templating><structure><error>
Structure unable to find _entry template
# Structure unable to find _entry template

(Asked by: username_0 on 2017-10-24)

I have a Structure named "pages" which is set to use the template named "_entry".
When trying to visit one of the pages I’m just getting a blank screen. 
The Craft log shows an error in the template loader because it can’t find a template.

Craft\TemplateLoaderException: Unable to find the template
  "about/index". in
  /path/to/site/craft/app/etc/templating/twigextensions/TemplateLoader.php:123

The structure is set to use the template named _entry which is present and all as it should be.
I have tried renaming the template to no avail. 
Other parts of the site are working fine. It only seems to be this Structure that has a problem.
The problem is occurring on an Azure VM running Ubuntu 16.04 LTS with PHP 7.0, running MySQL 5.7 with Strict mode disabled and managed with ServerPilot. I'm pretty sure it's been working OK since I deployed to Azure a couple of days ago but I can't explicitly remember testing these pages since my involvement has largely been on a different part of the site (which is working OK).
This is working fine locally, and has been working fine on a test server set up at Digital Ocean (I've decommissioned that but I'm in the process of setting it up again to test this).
Update: I can confirm the same code works perfectly on the Digital Ocean/ServerPilot combo so it appears to be something Azure or possibly MySQL 5.7 related (the Azure deployment is using MySQL 5.7 with Strict mode disabled)
Update: I'd incorrectly read the error message. The _entry template appears to be found. But this is then trying to load another template (in this case about/index) which is where things fail. 
There is no about/index template it should fall through to a generic template.
{% if craft.request.getSegment(2) %}
    {% set internal = craft.request.getSegment(1) ~ '/' ~ craft.request.getSegment(2) %}
    {% set index = craft.request.getSegment(1) ~ '/index' %}
{% else %}
    {% set internal = entry.uri ~ '/index' %}
    {% set index = entry.uri ~ '/index' %}
{% endif %}

{% include [internal, index, '_generic'] ignore missing %}

**Tags:** templating, structure, error


---

## 1 answers

### Answer by username_0 on 2017-10-24. Score: 1 | Accepted answer

Got to the bottom of it!
The _entry template relies on the fact there's a template error.
On the production site I'd added,
'suppressTemplateErrors' => true

to the config, which stopped the behaviour that was being relied upon to serve the generic template


---

