Skip to content

Instantly share code, notes, and snippets.

@jonathanheilmann
Last active May 4, 2016 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanheilmann/c75e139cf1e630f3125c to your computer and use it in GitHub Desktop.
Save jonathanheilmann/c75e139cf1e630f3125c to your computer and use it in GitHub Desktop.
Powermail in EXT:jh_magnificpopup (Working example: http://jonathan-heilmann.de/index.php?id=156)
#Powermail in EXT:jh_magnificpopup#
This modifications will try to open a powermail form in Magnific Popup.
This script uses ajax to process and submit the form. If ajax should not be used, you have to modify the powermail templates to open new pages with pageType (465678).
To still provide a fallback, the modified templated may be loaded only when parameter type is 465678 (if-clause in setup).
Demo: http://jonathan-heilmann.de/index.php?id=156
##Include static templates:##
#. Main template (powermail)
#. Powermail_frontend (powermail)
#. Add Demo CSS (powermail)
##Add setup##
See file setup.txt below
##Modify constants##
See file constants.txt below
##Add content element##
See file tt_content below for example.
plugin.tx_powermail.settings.javascript.powermailJQuery =
plugin.tx_powermail.settings.misc.ajaxSubmit = 1
page.jsFooterInline.50 = TEXT
page.jsFooterInline.50.value (
;(function($) {
$(document).ready(function() {
$('a.powermailByMfp').each(function(index) {
$(this).attr('href', $(this).attr('href') + '?&type=465678');
});
});
})(window.jQuery);
)
powermail = PAGE
powermail {
typeNum = 465678
bodyTagAdd = style="background-color: #fff; margin: 12px;"
config {
admPanel = 0
debug = 0
no_cache = 1
}
1 < styles.content.get
}
############################
# JavaScript and CSS section
############################
# add jQuery if it was turned on in the constants
powermail.includeJSFooterlibs.powermailJQuery = //ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
powermail.includeJSFooterlibs.powermailJQuery.external = 1
# add jQuery if it was turned on in the constants
[globalVar = LIT:0 < {$plugin.tx_powermail.settings.javascript.addAdditionalJavaScript}]
powermail {
# Inlude JavaScript files
includeJSFooter {
powermailJQueryDatepicker = EXT:powermail/Resources/Public/JavaScripts/jquery.datetimepicker.js
powermailJQueryFormValidation = EXT:powermail/Resources/Public/JavaScripts/parsley.min.js
powermailJQueryTabs = EXT:powermail/Resources/Public/JavaScripts/tabs.js
powermailForm = EXT:powermail/Resources/Public/JavaScripts/form.js
}
}
[end]
###
# CSS Demo
###
powermail.includeCSS.powermailCssDemo = {$plugin.tx_powermail.settings.CssDemo}
<p><a href="http://jonathan-heilmann.de/?id=157" class="mfp-link external-link-new-window powermailByMfp" title="Open link in Magnific Popup" data-htmlarea-external="1">Das ist ein einfaches Beispiel, welches Powermail in Magnific Popup öffnet.</a></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment