Is there a way to move the progress bar of a form to the bottom of the page instead of the top? If so, how? I tried to search in the form templates but I couldn't find a direct reference in the twig files that would allow me to move it.
Thanks!

Comments

smurfxx created an issue. See original summary.

cilefen’s picture

Category: Feature request » Support request
jrockowitz’s picture

Status: Active » Fixed

In a form alter hook, you can change the $form['progress'] weight or alter the $form array.

ChatGPT suggested the below approach, which is completely valid and the simplest solution

/**
 * Implements hook_form_alter().
 */
function mymodule_form_alter(array &$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  // Check if the form ID matches the webform submission form.
  if ($form_id == 'webform_submission_form') {
    // Save the progress element into a temporary variable.
    $progress_element = $form['progress'];
    // Remove the progress element.
    unset($form['progress']);
    // Add the progress element to the end of the form.
    $form['progress'] = $progress_element;
  }
}

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.