Kirby Builder: Use custom snippet in Panel

Hi everyone,
I am using Tim Oetting Kirby Builder-Plugin and would like to ask, if there is a chance to customize the builder snippets for the panel.

My scenario is:
I use a snippet to preview the content in my panel like this:

Inside my imagebanner.php are certain elements which I do not want to show when the plugin is being used in the panel.

Is there a chance to detect if a snippet is being used in the panel or on the frontend?
Maybe something like this:
if ($page->isPanel() == true)

Many thanks,
Matt

If hiding them via css is an option, you could use the custom panel stylesheet.

You could try:

if(function_exists('panel')) {
  ...
} else {
  // something else
}
1 Like

thanks flokosiol
but I try to disable links inside my panel snippet. currently some users click on the builder item preview itself (and not the β€œedit” button below) to edit the item. but this redirects them to frontend page β€” which is of course the desired behaviour on the frontend but not on the panel :wink:

@texnixe

many thanks! this works and is exactly what I was looking for :slight_smile: