London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Hide Media from Optimizely's Link Editor

Vote:
0

Our client uses their own DAM system and therefore wants to remove/hide the field Media from a Link editor where one adds Page/language/Media/Title/Email/External link/Remaining/Url

Has anyone being able to do it? 

#291768
Nov 16, 2022 14:42
Vote:
0

Try using an editor descriptor, you can OverrideDefault with your own widget or look at other options available to remove a specific input

    [EditorDescriptorRegistration(
    TargetType = typeof(string),
    UIHint = "HyperLink",
    EditorDescriptorBehavior = EditorDescriptorBehavior.OverrideDefault)
]
    internal class CustomLinkEditorDescriptor : EditorDescriptor
    {
        public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
        {
            base.ModifyMetadata(metadata, attributes);

            if (!metadata.EditorConfiguration.ContainsKey(("providers")))
            {
                return;
            }

            var providers = (metadata.EditorConfiguration["providers"] as IEnumerable<object>).ToList();

            metadata.EditorConfiguration["providers"] = providers;
        }
    }

This gave me the following view 

#291784
Edited, Nov 16, 2022 17:24
Vote:
0

Thanks Minesh, but this doesn't help in hiding/removing only media  

#292516
Dec 01, 2022 9:42
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.