I've tried to preprocess a webform in order to convert the form items into an ordered list. My webform is composed of questions, and I want each question to be a enumerated list element.
The problem is that I cannot find where to convert the
<div> following the
<form> into an
<ol>, and the next nested
<div> into an
<li>. After navigating webform's source code I could not find a function that says "give me all the webform elements", for example. It all seems to work in the following order:
- implement hook node load (load webform components)
- implement hook node view (order webform components into a structure that is hard to modify?)
- create form
- render form using some theming functions
When I use the node preprocessor to alter the components (and attempt to insert a #type = item_list somewhere), it doesn't work. And when using one of the webform theming functions, the data structure comes in a way that is hard to modify. Example:
That variable that I tried to modify was the
$variables['elements']['webform']['#form']['submitted'] in a hook_preprocess_node.