overwriting module config in addons like forms

207 Views Asked by At

I am developing a solution in EpiServer 10 and I have installed some addons like EpiServer form. Now I want to change the styles of the forms, and the easiest way that comes to my mind is to change the modules.config file for the component.

<clientResources>
    <add name="Forms" path="ClientResources/epi-forms/themes/sleek/Forms.css" resourceType="Style" />
</clientResources>

But for some addons like EpiServer.Forms, the module.config file is in zip folder and therefore will be erased with each update. What is the correct way to do this?

2

There are 2 best solutions below

0
On

According to the documentation :

You can alter the default styling of a form by directly modifying the CSS file in wwwroot\modules_protected\EPiServer.Forms\0.22.0.9000\ClientResources\ViewMode. You can modify styling rules freely but the following rules apply:

When you adjust the HTML of the view template element, keep the structure (parent-child, block-element relation) and default class names as-is.Keep default CSS classes in the element view template as-is. You can add your own, but do not remove the existing ones.

0
On

You can add an additional stylesheet to be loaded when the Forms add-on is loaded.

If you add the following to the module.config file in your site root...

<clientResources>
   <add name="Forms" path="/My/Custom/Style.css" resourceType="Style" />
</clientResources>

...it will be loaded when the Forms add-on is loaded.