Open link in new window?

Create awesome game website with Game Magazine Joomla template
GK User
Fri Dec 27, 2013 10:33 pm
From the main category window (where the images scroll through giving different headlines) is there a way to change options so that some can open in new windows, others can open in main window?

I want to use this to link to some of my own articles, as well as link to outside sources, but anything "outside" i want to open in a new window so that people aren't driven away from my site.
User avatar
Senior Boarder

GK User
Sat Dec 28, 2013 10:37 am
You can use metod described here:
http://css-tricks.com/snippets/jquery/o ... ew-window/
Please post an URL to your site, and I'll provide more detailed description on how to do it.
User avatar
Moderator

GK User
Sun Dec 29, 2013 8:22 pm
if possible, i'd rather just edit the .php file, wherever it's located, to add the target="_blank" attribute

can you tell me which file would control those links?
User avatar
Senior Boarder

GK User
Thu Jan 02, 2014 4:49 pm
Is there a chance you could post an url to site where you would like to make the change and make a screenshot of elements that should have this functionality?
User avatar
Moderator

GK User
Sat Jan 04, 2014 3:04 am
we can use this, since it's the same thing, i dont want to publicly post a domain

http://demo.gavick.com/joomla25/gamemagazine/

If i want to open "Avatar-The Game" in a new window instead of the current window, that's what I'm aiming to achieve.
User avatar
Senior Boarder

GK User
Sat Jan 04, 2014 11:38 am
I would suggest to stick to JS method, only modify it so it address only this module:
Code: Select all
$('#gkHeader a.gkIsTextItem').each(function() {
   var a = new RegExp('/' + window.location.host + '/');
   if(!a.test(this.href)) {
       $(this).click(function(event) {
           event.preventDefault();
           event.stopPropagation();
           window.open(this.href, '_blank');
       });
   }
});


Creating such method in php would require writing new functionalities to our modules, and sadly this is beyond our support.
User avatar
Moderator


cron