This forum has moved, please join us on github discussions. We will keep these old posts available for reference. Thank you!

Apostrophe-modal

Any Example code to initalize a modal pop-up from within a widget?

Were you looking for something of use in editing the widget, or something for use on the front end by the public?

Hi there,

I am working with apostrophe and need to create a modal that displays an html code for users to be able to copy and paste. Through routes, I process the some html, get css inline, then save that html with css inline in a html file and finally, send response calling the modal template the same way is done at apostrophe-tags.

However, when I try to include the html code inside the modal template, let’s call if manager.html (as in aspotrophe-tags), it does not get displayed. Also, I noticed that in both apostrophe-tags and apostrophe-pieces, to populate the div with the required data you called a REFRESH function that eventually gets the DATA by calling some function in the API.JS of the module.

But because I don’t need to retreive data from the database, I am not sure if that would be the best path to follow. But not sure, if It will be better to pass the html as string to the modal and how or whether to call the html file from the modal to populate it.

Thank you.
Diana

Diana, I wouldn’t really recommend using our modals for front end stuff that logged out users see. For that I would recommend writing your own CSS for the modal so you have control of the presentation.

The tags modal is indeed a good example to follow.

This forum is not really the place for how-to questions. If you’d like more help from the community on this issue, you could post to stack overflow with sample code for your attempted implementation so far, so folks can make specific suggestions. Be sure to use the apostrophe-cms tag.

Reaching out to support@punkave.com for an enterprise support plan is also an option.