Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When viewing a webform (e.g http://website.localhost/form/webform-name), I would like to display the webform's title as a page title above the form.
I was hoping to be able to achieve this by theming block.html.twig but the configuration object is populated as follows:
'id' => string(17) "system_main_block"
'label' => string(17) "Main page content"
'provider' => string(6) "system"
'label_display' => string(1) "0"
Is there a way I can access the webform's title so I can theme it on the page?
Thanks
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThis is not really a Webform specific question. There are many ways to alter a page title in Drupal.
If a form is the main output on a page, you can set the $form['#title'] property. Otherwise, you will need to Google other solutions like altering the title block.
This is a good question for https://drupal.stackexchange.com/questions/tagged/webform.
Once you have solved this issue, you should give back to the community write a recipe that contains your solution.
Comment #3
danjordan CreditAttribution: danjordan commentedThanks Jacob for the direction. The issue ended up being more generic that just a webform page title issue and was resolved by editing the page.html.twig template.
Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented