I need to store Javascript/HTML code in some of our entries. I have tried to put the code in plaintext but cannot get the code to render through twig. I cannot store this stuff on the filesystem. It really needs to be attached to an entry if possible.

Any ideas?

  • There are a few plugins which make adding code to entries a nicer experience... Check out Ace Freely or Code Block.
    – Lindsey D
    Nov 28 '15 at 20:26

Store it in a plaintext field, then when you output it, do: {{ entry.myfield | raw }}

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.