Code snippet entries

Ok, I get the idea.

I think the solution depends on the budget, time, how often it changes and the skill level of the editor(s).

By default, I prefer to be in control as a developer. Editors can mess things up. But making it more robust usually takes more time, so that’s a trade off.

  • The easiest is to just dump some code in a text area (I prefer a text area, a rte can strip stuff). It’s by far the easiest, but editors can mess things up and if you literally insert what’s in the text area in your HTML it might even break the frontend worst case. So editors need to know what they are doing.
  • A step more robust is for you to add the code to the page and only enter something like a unique identifier for trust pilot into the backoffice. You can even do some basic validation on it. Also, when the code changes, you don’t need to update the code in multiple content fields. Editors cannot break the frontend this way. The only downsite is that editors need to know what the identifier is and where to get it.
  • Ofcourse you can even make it nicer at the cost of much more time.

So all in all, I would say option 2 is the best for you.