open "text" link in new window

Easily add amazing slideshow to your Joomla website with free Image Show module and manage them using slide manager
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Wed Nov 27, 2013 6:27 am
I'd like to be able to have any "Slides" that are categorized as "Text" to open the selected URL in a new window instead of current.

I believe it's to be done in the slidemanager.php but I'm not entirely sure which line, and don't want to go poking around and screw something up.
User avatar
Senior Boarder

GK User
Thu Nov 28, 2013 3:59 pm
Hello,

In which style would you like to do this?
User avatar
Administrator

GK User
Wed May 21, 2014 3:38 am
Hi Dziudek - im sorry for taking FOREVER to respond - I forgot about this. I am using gk_game_Magazine

I am editing view.php, and wherever I have seen <?php echo $link; ?> I have added in the _blank target as such

<a href="<?php echo $link; ?>" target="_blank" class="gkIsListItem"><?php echo $title; ?></a>



I can get the "title" to open in a new window, but if the user clicks the image, instead of the title on top of the image, it'll still open in current window and I cannot find any other elements to add the _blank target attribute to.

Can you please help =)
User avatar
Senior Boarder

GK User
Wed May 21, 2014 10:09 am
It is caused by fact that the slides are opened by script not by the link and I afraid that there is no easy way to emulate target="_blank" in the scripts - you can try to replace in the style script the following fragment:

Code: Select all
elmt.addEvent("click", function(){window.location = elmt.getProperty('alt');});


to:

Code: Select all
elmt.addEvent("click", function(){window.open(elmt.getProperty('alt'));});
User avatar
Administrator

GK User
Thu May 22, 2014 2:25 am
Hmm...I dont even see that in the /interface/scripts/engine.js (thats the only script I'm seeing...am I missing one?)

Would it be easier to make the images so they aren't links at all? And if they wanted to open the link, they HAVE to click the text?
User avatar
Senior Boarder

GK User
Thu May 22, 2014 2:45 am
Scratch the above - I was looking in wrong directory. For anyone wanting to do the same thing as I was talking about here, to get the TEXT link to open in a new window, you'll need to edit view.php as described above

to get the image link to open in a new window, edit line 62 as described by dziudek above in

/modules/mod_image_show_gk4/styles/gk_game_magazine/engine.js

(you'll need to change gk_game_magazine to your specific style)

THANK YOU! IT WORKS PERFECTLY NOW!
User avatar
Senior Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.