I'm noticing a UX issue where users viewing multi-page forms on phone-sized devices have no good way of knowing the title (and thus the purpose) of the wizard page they're currently viewing. Page titles are still present in the wizard progress bar, but hidden due to lack of space for the words to fit, so editing the form's css to reveal them at mobile widths is not a solution.
Is there a way I can access the current wizard page's title and put it in a Computed Twig to display at mobile widths so my users know what the current wizard page is all about?
I can grab the current page's key using the following code:
{{ webform_token('[webform_submission:current-page]', webform_submission) }}
But this does not return the title property of the element as one might hope:
{{ webform_token('[webform_submission:current-page:title]', webform_submission) }}
I don't see the above possibility in the Tokens list and {{ current_page }}
outputs nothing. Is there another way to get to the current page's "title" property?
Comment | File | Size | Author |
---|---|---|---|
#5 | 2941067-3.patch | 1.36 KB | jrockowitz |
|
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedRight now you would have to write custom code.
We should add support for a [webform_submission:current-page:title] token.
Comment #3
nodecode CreditAttribution: nodecode commentedRight on, then I'll make this a feature request.
Comment #4
nodecode CreditAttribution: nodecode commentedComment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedPlease review the attached patch.
Comment #7
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI committed the patch. Please download the latest dev release to review.
Comment #8
nodecode CreditAttribution: nodecode commentedWorks like a charm