How to add a custom style / form theme

Add a custom style or form theme in ChronoForms.

Overview

The issue occurs because custom theme classes placed in the helpers/themes folder are not recognized by the system.
Instead of relying on unsupported themes, use the Custom Form Type in the Code tab to build HTML directly, or add HTML chunks via Custom Code elements in the Designer tab. Alternatively, modify an existing theme with caution or load CSS snippets using a Load CSS action in the form's On Load event.

Answered
an anne1979 02 May, 2016
Hello Bob,

in the generated wizard code it says:
echo \GCore\Helpers\Html::formLine($field["name"], $field);

for the output of my dropdown. In the called function, several containers and classes are added to the html output.
I saw, that there are "themes" and I would like to add a theme to fit my needs.

How can I do that? I added my theme class to the helpers/themes folder, but it is not recognised...
Could you provide a short example?

Thank you for your help,
Anne
Gr GreyHead 02 May, 2016
Answer
Hi Anne,

You can build entirely custom HTML for your form using the Code tab and setting the Form Type to Custom. I don't usually recommend this but it is entirely practical. As a half-way house you can add chunks of HTML - including inputs - in Custom Code elements in the Designer tab.

There is no direct support for Themes, but you could hack an existing theme to meet your needs (keep a backup as it may be over-written if you upgrade CF). Or you can load snippets or files from a Load CSS action in the form On Load event.

Bob
an anne1979 02 May, 2016
Thanks for pointing out the possibilities. 🙂
Anne
This topic is locked and no more replies can be posted.