Panel textarea with code

i have a panel > options structure field with an entry of type of textarea. i this field i add a codesnippet to be injected into the header of a page (like google analytics code but for A/B testing).
but the snippet gets included into the panel too. because its raw code obviously.
how can i resolve this? do i really have to add the code htmlescaped?

  type: structure
  entry: >
      type: page
      required: true
      default: product/abc
      type: textarea
      buttons: false
      required: true

ah yes. this echos the code to the page.

  $hipp = $site->headerinjectperpage()->toStructure();
  foreach ($hipp as $map) {
    if($map->uri()->toPage()->is($page)) {
      echo $map->code();

Fastest self-resolution ever :thumbsup:

nope. i have no problem eching the code to the page. but when i open the options in the panel the code is injected too.

Ah sorry you marked it as solved. My bad!
Do you really need to echo the code in the panel if it’s only for testing purposes?
If not, you could remove it from the "entry"
If yes, the easiest thing I see here is to use the snippetfield field instead of the structure so you can easily escape the code…

lol. “remove from entry” – it the perfect solution. thx @Thiousi