Forums / Cotonti / Extensions / Support / jQuery modals in plugins

Hodges
#37410 2013-04-24 13:57

Hi lukgoh,

Thanks for your two cents. Including the javascript directly in the plugin (<script> inside <body> tags) still does nothing.

And although $plugin_body "isn't needed anymore", it is still a fast way of incorporating html into the plugin. I believe the method you're alluding to that "more recent plugins" use is separate tpl files(?), however, this particular plugin is an old genoa plugin I'm forking, and I haven't yet had the time to move the html out of the php files.

If anyone could help me incorporate a working jquery modal into a plugin I'd be immensely grateful!!!

Added 27 minutes later:

Ok I've figured it out:

  1. Looked at one of the scripts cotonti includes by default: <script type="text/javascript" src="js/jquery.min.js"></script>
  2. Inside jquery.min.js is reference to jqModal
  3. Googling jqModal reveals: http://dev.iceburg.net/jquery/jqModal/
  4. Applying 'example 1' code (which calls the *.jqm function of jqModal) to my plugin WORKS!

God damn-it I wish this stuff was documented. All I've read on these forums is that cotonti uses plain old 'vanilla' jQuery. However, 'jqModal is a plugin for jQuery'.

Perhaps the cotonti developers would like to update the documentation to state all the js functions available to plugin developers how to use them (or links offsite with demos and instructions).

This post was edited by Hodges (2013-04-24 14:24, 11 years ago)