Hi everyone,
Currently, we are customizing the markup and applying CSS classes to our Kentico MVC forms by hooking into the backend using FormFieldRenderingConfiguration.GetConfiguration.Execute
. Here's a simplified version of what we're doing:
FormFieldRenderingConfiguration.GetConfiguration.Execute += InjectMarkupIntoKenticoComponents; // Inside InjectMarkupIntoKenticoComponents e.Configuration.RootConfiguration.HtmlAttributes["class"] += " my-custom-class";
This approach works well, but it requires backend code deployment for even simple CSS changes.
My question is:
Is there a way to apply CSS classes or customize form field markup either:
- Through the front end (e.g., via Razor view overrides), or
- Via the Kentico Admin Panel (Form Builder UI or other settings),
...without relying on backend C# event handlers?
We want to make styling changes more accessible to content editors or front-end devs without modifying and deploying backend code.
Has anyone implemented a more flexible or dynamic way of styling forms this way?
Thanks in advance!
Environment
Xperience by Kentico version: [30.5.1]
.NET version: 8
Link to relevant https://docs.kentico.com/documentation/developers-and-admins/development/builders/form-builder/form-widget-customization