Progress bar position Drupal 11

Created on 18 March 2025, about 2 months ago

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!

Feature request
Status

Active

Version

6.3

Component

Code

Created by

🇮🇹Italy smurfxx

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @smurfxx
  • 🇺🇸United States jrockowitz Brooklyn, NY

    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;
      }
    }
    
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024