{formpart}

Description

Prints the number of the current form part. Form parts are tabbed sections of a slice input form created by formbreak, formbreaktop and formbreakbottom; each of those breaks increments a part counter, and formpart prints its current value. The counter starts at 0 and is reset at the start of every expansion pass, so with no break before it the result is 0, after one break 1, after two breaks 2, and so on. Typical use is inside a fields Input-before-HTML to tag each parts table rows with a part-specific CSS class for styling. Takes no parameters.

Examples

virtual{formpart:}
Expected(the current form-part number; 0 before any formbreak)
Actual0
With no formbreak before it in the same pass, the counter is 0.
virtual{formbreak:Details}{formpart:}
Expected(the part number after one split; 1 in a fresh form)
Actual1
One formbreak makes the counter 1, so formpart prints 1.
virtual{formbreak:A}{formbreak:B}{formpart:}
Expected(the part number after two splits; 2 in a fresh form)
Actual2
Each formbreak adds one; after two breaks the part number is 2.
virtual<tr class="formrow{formpart}">...field row...</tr>
Expected(field rows of each part get class formrow0, formrow1, ... so CSS can style parts differently)
Actual...field row...
In a fields Input-before-HTML, formpart stamps each parts table rows with a part-specific class (formrow0, formrow1, ...) so the input form can be styled per part. This is the real-world usage found in production slices.