Is there any way to reference an existing Popup from a button?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
When building a page I find times when it make sense for the same popup to be invoked from multiple buttons on the page.

Typically the first time you use the create popup option and you get a nice blank popup and you get to work dragging and dropping your elements.

Once I have that popup the way I want it and I am creating a new button perhaps on a different tab that I want to share that popup is there a way to reference an existing popup?
Photo of Joseph Ucuzoglu

Joseph Ucuzoglu

  • 1,096 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,250 Points 10k badge 2x thumb

Your best bet is to create the pop up as a standalone page.  Then add a popup with a page include to pull in your existing 'popup'.  This will keep you declarative.

If you go the snippet route, you can open a popup using a snippet.  Then each time you want to open the popup, you just need to have the button run the snippet.

A third option that keeps you away from coding a snippet is to go to the XML view in the page builder and copy your popup XML definition.  You are 'copying code', but it saves you the steps of manually building the popup.


Photo of Matt Small

Matt Small

  • 1,182 Points 1k badge 2x thumb
Why not try a wrapper with a render condition. Create a model and a UI field that updates to a value on button click (or anything else you want that can have multiple actions). You can also make the other page elements render conditions = null so this will be the only page content seen at the time you want to display the "pop up."