RSS Amplifier

Gulla.net · Aug 15, 2024

Set icon for your Optimizely CMS custom form elements

0
Sign in to vote or save

Tomas Hensrud Gulla · Tomas Hensrud Gulla

  1. Home
  2. Blog
  3. Set icon for your Optimizely CMS custom form elements

In Optimizely CMS you can create your own form elements, inheriting from InputElementBlockBase or any of the existing element types – but what about the icon that the editors see?

Have a look at this form, with two elements

  • Custom elemen inheriting InputElementBlockBase
  • Submit button

Custom form element with default icon

Not surprisingly, the custom element has a very generic icon. To change the icon, we can use a UI descriptor like this:

[UIDescriptorRegistration]
public class ConsentElementBlockDescriptor : UIDescriptor<CustomElementBlock>
{
    public ConsentElementBlockDescriptor()
    {
        IconClass = "epi-forms-icon epi-forms-icon--small epi-forms-choiceelementblock__icon";
    }
}

And the custom form element is now shown as a checkbox.

Custom form element with updated icon

That's it!

Read the original on gulla.net

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.