Skip Navigation

[Résolu] Passing a parameter to a popup (Divi Overlays)

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

I have a view that lists businesses and another view that displays a single business' details. Ideally, I would click on a "Details" link and pass a parameter to a popup, and the popup contains a view controlled by the parameter, but that doesn't work.

Solution:

1) Toolset Views does accept URL parameter to filter the view's result, it is a built-in feature of Toolset Views/Blocks plugin.

2) The problem is the Divi popup does not accept URL parameter

Relevant Documentation:

https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/#controlling-the-filter-with-url-arguments

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Marqué : ,

This topic contains 4 réponses, has 2 voix.

Last updated by DavidW2160 Il y a 1 an et 2 mois.

Assigned support staff: Luo Yang.

Auteur
Publications
#1729951

I have a view that lists businesses and another view that displays a single business' details. Ideally, I would click on a "Details" link and pass a parameter to a popup, and the popup contains a view controlled by the parameter, but that doesn't work. The issue seems to be that parameters (e.g. "post-ids=[wpv-post-id)") can't be passed to popups (Divi Overlays). The only alternative that seems workable is to pass a parameter to a php script that in turn does the heavy lifting - either somehow filter the view I need some help figuring out how to make this work.

#1730285

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

I think there are some misunderstandings:
1) Toolset Views does accept URL parameter to filter the view's result:
https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/#controlling-the-filter-with-url-arguments
It is a built-in feature of Toolset Views/Blocks plugin.

2) The problem is the Divi popup does not accept URL parameter, can you confirm it?

There is a workaround does not need custom codes:
After user click each link you mentioned above(e.g. "post-ids=[wpv-post-id)"), open different DIVI pupup, in each popup content, display a view shortcode with different shortcode attribute, for example:
[wpv-view name="houses" ids="[wpv-post-id]"]

See the document I mentioned above:
section "Controlling the filter with shortcode attributes"

#1731259

1)Yes, I know that views accept URL parameters, but evidently the popups don't accept URL parameters.

2) Are you saying that I would need a separate popup for each "busienss" post_id, even though I'm using the same view? That's not workable. That would mean that I would have to create a new popup for each entry in my business/membership list, which would require manual interaction each time someone signed up.

#1732657

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

It depends on Divi popup, you can check it with Divi supporter, check if Divi popup accepts URL parameter.

With Bootstrap Modal, you can open a popup and load HTML "iframe" tag, and pass URL parameter to target page in "src" attribute of "iframe" tag, in the target page, display the view shortcode, see below example:
https://stackoverflow.com/questions/25565716/load-iframe-in-bootstrap-modal

More help:
hidden link

#1737739

My issue is not resolved, but I've taken a different approach. Thank you!