In this wiki lets know the different ways to open popup from DNN HTML module.
Suppose in some time requirements comes as to open content in a popup on click of a link present in HTML Module.
DNN has added dnnModal.show to version 6 onwards, by using which we can do this.
For Version 6 onwards:
In HTML module i have content as:
<a href="#" id="ancPopUp">Sunil</a>
Now HTML modules Settings>Advance Settings, place the below script to the header section
< script type="text/javascript">
$(document).ready(function () {
$("#ancPopUp").click(function () {
dnnModal.show(MyUrl + '?popUp=true', false, 550, 950, false);
return false;
});
});
</ script>
This will open up the popup on link click.
For version prior to 6:
We can do this using the jquery fancybox.
In HTML module i have content as:
<a href="MY URL" id="ancPopUp">Sunil</a>
Now HTML modules Settings>Advance Settings, place the below script to the header section
< script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#ancPopUp").fancybox({
'autoDimensions': false,
'autoScale': false,
'width': 614,
'height': 546,
'enableEscapeButton': false,
'hideOnOverlayClick': false,
'scrolling': 'no',
'type': 'iframe'
});
});
</ script>
This will also do the same work.