Hello,
I need a simple modal popup when a link is clicked. I tried the example from the Bootstrap website but it didn't work because I don't know how to properly integrate it into Phoenix.
Thank you.
How to create a modal/popup when link is clicked?
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
Re: How to create a modal/popup when link is clicked?
There are a few examples that show how it is done in PRO Supporters Addons e.g. IIRC s02e06 Product Terms has a product_info module that has that behaviour.
-
lecarlb
- Contributor
- Posts: 316
- Joined: Mon Oct 26, 2020 5:26 pm
- Phoenix Version:
- Has thanked: 48 times
- Been thanked: 9 times
Re: How to create a modal/popup when link is clicked?
Thank you for your help. I'm still stuck. I don't know where to begin or where to place the code.heatherbell wrote: ↑Tue Jul 06, 2021 7:30 amThere are a few examples that show how it is done in PRO Supporters Addons e.g. IIRC s02e06 Product Terms has a product_info module that has that behaviour.
-
lambro28
- Member
- Posts: 62
- Joined: Sun Jan 03, 2021 2:47 pm
- Phoenix Version: v1.1.0.6
- Has thanked: 11 times
- Been thanked: 8 times
Re: How to create a modal/popup when link is clicked?
What page(s) do you want the pop to appear on?
-
lecarlb
- Contributor
- Posts: 316
- Joined: Mon Oct 26, 2020 5:26 pm
- Phoenix Version:
- Has thanked: 48 times
- Been thanked: 9 times
Re: How to create a modal/popup when link is clicked?
I just want it to pop up when a link is clicked. For example, "Learn more".
It will be in a header module.
Thank you.
- zipurman
- Builder
- Posts: 540
- Joined: Tue Oct 13, 2020 5:20 pm
- Phoenix Version: v
- Has thanked: 93 times
- Been thanked: 162 times
Re: How to create a modal/popup when link is clicked?
You could read this as it walks you through how to do this in bootstrap.
https://getbootstrap.com/docs/4.6/components/modal/
https://getbootstrap.com/docs/4.6/components/modal/
zipurman
-----------
-----------
-
lecarlb
- Contributor
- Posts: 316
- Joined: Mon Oct 26, 2020 5:26 pm
- Phoenix Version:
- Has thanked: 48 times
- Been thanked: 9 times
Re: How to create a modal/popup when link is clicked?
Thanks. I read that. My issue is where to place that code. Then I know there's some .js that goes along with it. My guess is to place both pieces of code in the module.zipurman wrote: ↑Wed Jul 07, 2021 6:48 am You could read this as it walks you through how to do this in bootstrap.
https://getbootstrap.com/docs/4.6/components/modal/
-
Fiber
- Contributor
- Posts: 173
- Joined: Mon Oct 26, 2020 12:16 pm
- Phoenix Version: v1.1.0.6
- Has thanked: 17 times
- Been thanked: 27 times
Re: How to create a modal/popup when link is clicked?
Why not copy includes/modules/content/header/cm_header_buttons.php and the files associated with it? Rename to the new situation..you don't need part of the code in the template file anymore and delete it and replace the code for the popup, translate properly en turn on in the admin en no core changes :-)
Turn up the Max
-
lecarlb
- Contributor
- Posts: 316
- Joined: Mon Oct 26, 2020 5:26 pm
- Phoenix Version:
- Has thanked: 48 times
- Been thanked: 9 times
Re: How to create a modal/popup when link is clicked?
I'll try that. Thank youFiber wrote: ↑Wed Jul 07, 2021 9:28 amWhy not copy includes/modules/content/header/cm_header_buttons.php and the files associated with it? Rename to the new situation..you don't need part of the code in the template file anymore and delete it and replace the code for the popup, translate properly en turn on in the admin en no core changes :-)
- burt
- Core Team
- Posts: 4551
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: How to create a modal/popup when link is clicked?
There are a couple of examples of modal in the core code, off the top of my head there is;
1 in advanced_search
1 in create_account (and the same one in checkout_confirmation)
The advanced search one would be easiest to follow I think.
1 in advanced_search
1 in create_account (and the same one in checkout_confirmation)
The advanced search one would be easiest to follow I think.
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.