- This topic has 8 replies, 5 voices, and was last updated 12 years ago by .
Viewing 9 posts - 1 through 9 (of 9 total)
Viewing 9 posts - 1 through 9 (of 9 total)
- The topic ‘Module vs Plugin and target _blank’ is closed to new replies.
Support Home Page › Forums › Joomla Software › Easy Folder Listing Module › Module vs Plugin and target _blank
Hi,
I first installed the Easy File Listing module and it worked great except I couldn't open files in a new window (target _blank). So I purchased the plugin and it opened the files in a new window, but my Frontpage Slideshow won't work when the plugin is enabled. I am new to Joomla so think it might be easier to figure out how to open files in a new window with the module, than trying to figure out why the plugin and slideshow conflict.
My question: can I have the module open files in a new window?
Other than that, the extension is so easy to install and configure! It does (almost) everything I need!
Thanks,
Joanne
Yes you can make the files open in a new window. Look in the file “helper.php” around line 246 and line 193.
Change
$html .= '<a href="'.JURI::base().$folder.'/'.$rows[$i]['name'].'.'.$rows[$i]['ext'].'">';
to
$html .= '<a target="_blank" href="'.JURI::base().$folder.'/'.$rows[$i]['name'].'.'.$rows[$i]['ext'].'">';
Look for anything with “href” in the text. This tells you it’s a link. Then just add the “target=”_blank”
Hope this helps!
Thanks! That worked perfectly.
For everyone’s information, this code has been moved to the default.php in the tmpl folder. So, to add the functionality, edit the default.php file at line 71. This change applies to version 2.5 or later.
Hi!
I’ve been checkin in /modules/mod_easyfolderlisting/helper.php in order to add some <target=”_blank”> but could not find any “href”. What am I doing wrong?
Thanks in advance.
@tapi. Please look into the tmpl folder in the default.php file.
Hi Michael,
First of all I’d like to thank you for the great Module, I love it.
Now I want the link taget be opened i a new window (using version 2.6) and I found the code snippet in the default.php file and changed it as descripted above. But unfortunately it doesn’t work.
Do you have an idea how to manage this?
Kind Regards,
Mina
@Minas_Hund. You had to do this in both the list.php file and the default.php file. Find the line that says:
1 |
echo '<a href="'.JURI::base().$folder.'/'.$fixedName.'.'.$rows[$i]['ext'].'">'; |
and change it to:
1 |
echo '<a target="_blank" href="'.JURI::base().$folder.'/'.$fixedName.'.'.$rows[$i]['ext'].'">'; |
Great! Now it works!
Thx for your quick reply and help!
Kind Regards,
Mina