The 'Wizard' Returns to Exponent

The WizardOne feature which didn't make the move from Exponent 1.x to 2.x was the 'Wizard'...essentially a sequential set of forms.  Well 'ta-daaa', we're planning to have a wizard or paged-form feature in the next release (already in the 'develop' code branch)!  This will be a much simpler implementation than available in 1.x, as a 2.x paged form can easily be designed all in one place, instead of having to create separate form pages, etc...  This feature will be available in both the forms module/site forms (event registration now uses site forms) and in templates/views.

You may be asking, 'how does a paged form or wizard work?'  Well in many of the system forms, we use 'tabs' to segregate collections of input, and recently also introduced 'groups' to further segregate sets of controls on a page/tab.  These will still be used in most cases, but in some scenarios a sequential or progressive set of controls is more intuitive.  This is more evident in a complex form requiring a great deal of customer input such as a 'camp registration and release' form.  On the other hand, the 'site configuration' form is NOT intended to be sequential and would be practically unusable if it did not remain as a tabbed form.

How will a paged form work in Exponent?  In the form designer, it will be as simple as adding a 'form page break' control as the first/top control, and placing one where ever you want to begin a new 'form page'.  Exponent will do all the heaving lifting from that point.  If you want to revert to a standard form, you'd simply remove/delete the page break controls from that form using the form designer.  In practice a paged form would have at least two page breaks (including the top one) with one or more being the break(s) between the different pages.

The result will then look something like this.  Exponent performs input validation on all visible controls prior to moving to the next 'page.'  And as the development code matures prior to the next release, we will likely add form module configuration settings to enable/disable certain features like the 'page' description (Basic Information, etc...) appearing below the 'page' caption (Step 1, Step 2, etc...) AND also at the top of the current 'page', etc...

How will a paged form work within a template/view?  In the simplest sense a 'paged' form is simply one with controls grouped inside 'fieldsets' and then a jQuery plugin is used.  The {form} block function has been updated to accept a new 'paged' parameter which now also requires you pass an 'id' or 'name'.  Then within the form you group pages of control with the 'page' block with a required 'label' and an optional 'description' param.  Let's take a module view (mass-mailer) that is currently coded like this:

    {form action=mass_mail_out}
        {group label="Send this Message To"|gettext}
            {control type="checkbox" class="emailall" postfalse=1 name="allusers" label="All Site Users?"|gettext value=1 description='Uncheck to allow user/group/freeform selection'|gettext}
            {control type="checkbox" postfalse=1 name="batchsend" label="Batch Send?"|gettext value=1 checked=1 description='Hide email addresses from other users'|gettext}
            {userlistcontrol class="email" name="user_list" label="Users"}
            {grouplistcontrol class="email" name="group_list" label="Groups"}
            {control type="listbuilder" class="email" name="address_list" label="Other Addresses" size=5}
        {/group}
        {group label="Message"|gettext}
            {control type="text" name="subject" label="Subject"|gettext}
            {control type="html" name="body" label="Message"|gettext}
            {control type="uploader" name="attach" label="Attachment"|gettext description='Optionally send a file attachment'|gettext}
        {/group}
        {control type="buttongroup" submit="Send"|gettext cancel="Cancel"|gettext}
    {/form}

a 'paged' version (if we wanted one) is easily created and would be coded like this:

    {form action=mass_mail_out name='mass-mail' paged=1}
        {page label="Send this Message To"|gettext description="Select Recipients"}
            {control type="checkbox" class="emailall" postfalse=1 name="allusers" label="All Site Users?"|gettext value=1 description='Uncheck to allow user/group/freeform selection'|gettext}
            {control type="checkbox" postfalse=1 name="batchsend" label="Batch Send?"|gettext value=1 checked=1 description='Hide email addresses from other users'|gettext}
            {userlistcontrol class="email" name="user_list" label="Users"}
            {grouplistcontrol class="email" name="group_list" label="Groups"}
            {control type="listbuilder" class="email" name="address_list" label="Other Addresses" size=5}
        {/page}
        {page label="Message"|gettext description="Email Content"}
            {control type="text" name="subject" label="Subject"|gettext}
            {control type="html" name="body" label="Message"|gettext}
            {control type="uploader" name="attach" label="Attachment"|gettext description='Optionally send a file attachment'|gettext}
        {/page}
        {control type="buttongroup" submit="Send"|gettext cancel="Cancel"|gettext class='finish'}
    {/form}

As with all pre-release code, the specifics listed above are subject to change prior to the actual release.

We've also already added another 1.x feature missing in 2.x...'Configuration Profiles' which allows backing up and restoring the current site configuration (on the server).  This becomes really handy in a test or development environment as you can very quickly switch between databases and themes to test a new feature or customization.

Comments

No Comment yet