Prevent files from being clickable inside a structure field

Hi :slight_smile:

Usually I prevent files in the backend from being clicked (an leading the user away to a new page) like this:

type: files
link: false

But as soon as I use a files field inside a structure field, this doesn’t work anymore.

Any ideas how I could fix this? The reason why I want to prevent this is because it is usually a bad user experience for my clients how maintain the sites.

Thanks and best wishes
Nahuel

The easiest way I could think of, is a tiny bit of some custom panel css.

.k-bubbles-field-preview.k-files-field-preview a {
  pointer-events: none;
}

I guess, the other solution would be to write your own field preview.

1 Like

thats a pretty solid idea :smiley:

This will of course target all files preview fields in all structure fields across the site.
You could target that specific structure field by prepending it’s name to the k-files-field-preview selector.

.k-field-name-whatveryoufieldiscalled .k-bubbles-field-preview.k-files-field-preview a {
  pointer-events: none;
}

…or so =)

1 Like