Dialog Modal & Conditionals Using "Current Page" Tokens...

Created on 1 August 2018, almost 6 years ago
Updated 20 June 2023, about 1 year ago

Hello,

The site that I maintain uses Webform Conditionals to determine which fields are displayed on certain pages. Specifically, I use a hidden field with the value [current-page:title] to identify the page. The conditionals applied to the appropriate fields show or hide them (usually, all but one field is hidden as they are semi-product specific. See: https://hartfordrents.com/360-camera-rental - The field "360 Camera Model:" that is 2/3 of the way down the form is shown while all other product-specific fields are hidden.

I am now experimenting with Dialog boxes and they are working fine except for the page-specific conditionals described above. I understand why this is happening; it is due to the fact that the form is being called into the dialog box as it's own page...

IE: a href="/form/quick-quote-form"

So, since it is it's own page essentially, it doesn't see the parent page's H1 tag and hence cannot fire the conditional for the field it needs to be displayed. All fields with conditionals are simply hidden since the page title of the form itself does not match the set conditions.

I am wondering if there is a way to either reference the form (in the href) in a way where it is still a part of the parent page or, is there an accepted token to refer back to the page and use that Page Title to fire the conditionals?

πŸ’¬ Support request
Status

Fixed

Version

5.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States ericroks

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡¦Canada liquidcms

    I guess the recipe for this was never put together?

    Trying to do what seems like the same thing but no luck. Some thing have possibly changed? There is no longer a Dialog Options; but i think just to provide help for the dialog url.

    I have tried this:

    <p><strong>Is there a problem with this page? <a class="btn webform-dialog webform-dialog-narrow" href="/en/form/user-feedback-form?source_entity_type=node&amp;source_entity_id=1187">Report problem</a></strong></p>

    both in a block and on the node page. both give same result for this token: [webform_submission:source-entity:title] which is the title of the webform; but the page it is sued on.

Production build 0.69.0 2024