Detect the Panel

Im using a snippet inside a Kirby Builder snippet that has a variable passed to it on the snippet. This does not work in the builder preview panels because the snippet is being read directly and not through the snippet helper. I end up with a Undefined variable warning.

Whats the best way to make it work? I was thinking i could detect the panel then hardcode a variable that it can see based on the panel being used. Is that possible? Or can i set a default value in the config that i can reset on snippets?

Ah… found solution.