I have a site consisting of 15 templates, all of which extend _layout.html. There is just one page (homepage) which needs to omit a chunk of the _layout.html. Is there something I can add to _layout which says "if I'm on the homepage leave this chunk of code out"?

Many thanks



Sorry... while searching for an answer to something else I discovered the solution to this :/

{% if craft.request.getSegment(1) != index.uri %}

    .... leave this chunk of code out

{% endif %}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.