External Links open in new window External Links open in new window
 

News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

External Links open in new window

Started by donsenilo, August 22, 2017, 02:47:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

donsenilo

Hi

I included this code right before the "</head>" in "template.html" (in my case "cpg15x\themes\curve\template.html"):
<script>
$(function() {
   $("a[href^='http']:not([href*='YOURDOMAIN.XXX'])").each(function() {
       $(this).click(function(event) {
             event.preventDefault();
             event.stopPropagation();
             window.open(this.href, '_blank');
        }).addClass('externalLink');
   });
});
</script>

Replace "YOURDOMAIN.XXX" with your domain !!!

What it does: it opens all links they are not containing your domain in a new window.

Maybe this is useful for you.

ron4mac

You are running CPG 1.6.x. If, in the future, you perform an automatic update to CPG, the curve theme will be overwritten, removing your changes. You should copy or rename the curve theme folder before making changes to its files. Then make that theme your default in the config.

ΑndrĂ©