I have a template with just this code:

{% include 'amenities/_types/amenities' %}

This results in a template error:

Object of class Craft\ElementCriteriaModel could not be converted to string

Never encountered this one before. What is causing this?

  • The error isn't being triggered here... it's being triggered in your _types/amenities template. Can you show the Twig code for that one please?
    – Lindsey D
    Mar 25 '15 at 20:45
  • Yep I figured this out actually. Chalk it up to a long day and I was just misreading the error! Thanks. Mar 25 '15 at 20:55

Well I now see this error was caused by the included template and not the fact that I was trying to include a template.

I thought that the error message would show the error on the included template that was the actual source of the problem, but it was just referencing the include as the error.

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.