2

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?

1
  • 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, 2015 at 20:26

1 Answer 1

4

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 and acknowledge you have read our privacy policy.

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