1

Folks:

I am having issue getting Twig to extend the template. The details:

  • Craft installed fine.
  • This is on a live server.
  • The default Craft welcome page appears as normal so Twig must be working.
  • When I try to pull up an entry with one of my own templates, Twig does not pull the content from the main Twig template. You should see the header info and have the css pulled and all the rest. If I strip everything out the template and leave some plain text I still see this in the browser:

    { % extends "_layouttest" % } { % block main % } This is the correct template alright! { % endblock % }

I have done the following:

  • Checked that I am not pulling the template directly. I am not. This is a proper URL for an entry I created in Craft.
  • Dumped the cache.
  • Checked the template locations from within the CP. All seems to be pointing in the correct direction. The fact that the right template is being pulled confirms this.
  • Read through this thread and this one. No joy.

Any assistance would be appreciated.

3
  • 2
    You don't actually have a space between the { and % in your code, do you? Commented Feb 23, 2016 at 21:56
  • You have so got to be kidding me, right? Yes, that was the problem. And no, I am not a complete dunce (but it feels that way). ExpressionEngine tags worked in a similar fashion. Thanks!
    – Wonko
    Commented Feb 24, 2016 at 2:01
  • Haha, cool. Posted it as an answer. :) Commented Feb 24, 2016 at 10:15

1 Answer 1

4

You have a space between the { and % in your twig tags. That needs to be removed. :)

Your Answer

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

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