0

I've just set up a multi-environment install of Craft but am having an issue on my local install under MAMP Pro. Everything seems to be loading fine except for my index template in the root of the 'templates' directory. It extends a _layout.twig template but when I load the site locally, only the layout template is being rendered (ie. my block overrides in the index template that extends it aren't being rendered).

However, this works fine on the remote version of the install.

Any thoughts or help would be appreciated as I'm scratching my head at this point...

Thanks.

Update - here is the code from _layout.twig and index.twig. Pretty straight forward - and these do work expected in the other non-local environment.

_layout.twig

<!DOCTYPE html>
<html lang="en">

<head>

    {% block head %}
        ...head code in here
    {% endblock %}


</head>

<body>

    {% block bodyContent %}
        ...presentational code in here
    {% endblock %}

    {% block footer %}
        ...presentational code in here
    {% endblock %}

</body>

</html>

index.twig

{% extends "_layout.twig" %}

{% set entries = craft.entries.section('homepage') %}

{% block head %}
    {{ parent() }}

    ...additional head code
{% endblock %}

{% block bodyContent %}
    ... presentational code overriding _layout
{% endblock %}

{% block footer %}
    ... presentational code overriding _layout
{% endblock %}
5
  • Can you edit your question and share the template code for layout.twig and index.twig?
    – Brad Bell
    Commented Dec 10, 2014 at 21:35
  • Have you ruled out caching already, as in you're seeing an older version of the index that doesn't include your overrides?
    – Matt Stein
    Commented Dec 10, 2014 at 23:08
  • I don't believe there are caching issues...updates to _layout are rendered fine.
    – Mike
    Commented Dec 11, 2014 at 22:35
  • Are you using PHP 5.5 or greater? If so, it has OpCache enabled by default which might explain what you're seeing that you can disable.
    – Brad Bell
    Commented Dec 12, 2014 at 4:49
  • Thanks Brad but I'm running 5.4.10. I continue to look at this but cannot fathom where the issue is... I'm debating removing MAMP and reinstalling.
    – Mike
    Commented Dec 12, 2014 at 17:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.