1

I have some content I wish to output in the main parent _layout.html template. Seems like something simple to achieve but can't seem to figure it out. If I call {{ entry.bannerLabel }} etc it throws twig runtime errors.

I'm wondering if it's because it's outside of the {% block content %} section of the template?

2

My bad. Total n00b error. Made the content a global so it can exist outside of specific template and solved it

1

There might not be an entry associated with the current URL, what is the exact twig runtime error?

  • The error is Calling unknown method: craft\elements\Entry::bannerLabel() – alex morris May 29 at 20:06
  • This means that there is no "bannerLabel" field on the entry object, but the entry object does exist. If the entry did not exist, it would say that :) – Clark Nelson May 30 at 16:49

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.