2

I need to hide a template field on both Content Editor and Experience Editor. For Content Editor, I could achieve it by overriding the GetFields pipeline. It still shows up on the Experience Editor. How do I hide it? Thanks in advance!

3
  • What do you want to achieve here? if you just want to hide it in experience editor only, you can simply check for PageMode.IsExperienceEditor in your view. Apr 14, 2020 at 15:07
  • 1
    Wouldn't it be a better option to use security settings on the field to hide it?
    – Gatogordo
    Apr 14, 2020 at 15:08
  • I need to hide it from the component's edit modal. Security route would be ideal, but we have not used field level security yet, so was wondering if we have an alternate way :-)
    – rpatwari
    Apr 14, 2020 at 15:12

1 Answer 1

1

Turns out we were using a SuperFieldEditor for our X-Editor to provide access to the template fields for the component.

Super Field Editor

So I fixed the issue by disabling Field access to all authors. Now it was little tricky since I wanted to write to the field, but not allow read. Here's what I ended up setting. Works!

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.