2

When you create a structure section you set which template that you would like to use. Is there a way to override that for a single entry in that structure? If I have missed it in the docs I apologise but it would appear that setting a route would not work due to the order things are looked up at.

2 Answers 2

3

I think my answer here should provide you with exactly what you need, as well as an elegant and reusable way to do it:

How can I route a specific entry in a structure section to its own template?

0
1

You could use include to load different templates conditionally like so:

{% if entry.id == '24' %}
    {% include "_entries/mystructure_special" %}
{% else %}
    {% include "_entries/mystructure_base" %}
{% endif %}

Also consider if it makes sense to add a new Entry Type for this one entry and then set things up per this tutorial: "How can I give each Entry Type its own template?".

1
  • Thank you for your answer @carlcs Ben's approach worked really well for me in this instance.
    – Gareth
    Dec 16, 2014 at 19:29

Your Answer

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

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