Forum
How does one trigger a Perch Modal Dialog in an add-on?
I'm updating some little admin console add-ons to appear more Perch-like using the pattern library.
It would be great to use the Modal Dialog as seen here: https://patterns.perchcms.com/components/detail/modal-dialog.html
The markup is clear, but I can't find any documentation on how to trigger the dialog to appear.
Can you point me in the right direction?
Perch: 3.0.8
Thanks, Drew! Is there a "Perch-y" way to know when Perch.UI.Dialog is available in JavaScript? Or is it just a matter of detecting when all page assets have loaded?
The Perch object didn't seem to be available on page load, so I used a setTimeout loop to detect when it was. Not elegant, but it works.
If there is a better way to do this, I'd be happy to hear it!
Are you not registering your code with Perch?
Apparently not. How does one do that?
I retract the question, because I'm realizing it's a big topic (app development).
In this case, I just have a single page of links that I wanted to wrap in the Perch interface. I've been able to accomplish that copying over some API calls from the core apps. So I'm good to go.