rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: dtrieb on July 17, 2014, 03:37:57 PM

Title: Web Links in new Window/Tab
Post by: dtrieb on July 17, 2014, 03:37:57 PM
It would be nice if i can set the Links that i add under right Click -> "New Link" open in an new window/Tab if i click on my htf server site!
Title: Re: Web Links in new Window/Tab
Post by: bmartino1 on July 17, 2014, 09:11:48 PM
if i'm reading this corectly, you want a website guest to click a link, and that link to open in a new tab
and/or a new window?

possilbe html solution:
http://stackoverflow.com/questions/15551779/open-link-in-new-tab

<a target="_blank" href="http://your_url_here.html">Link</a>
Title: Re: Web Links in new Window/Tab
Post by: rejetto on August 11, 2014, 11:37:54 AM
try pasting this diff template in your root folder

Code: [Select]
[+list]
<script>
$(function(){
  $("a[href^=http]").attr({ target:'_blank' });
});
</script>
Title: Re: Web Links in new Window/Tab
Post by: Awesoft on December 09, 2016, 01:02:13 PM
I tried the code in the root/home icon: Properties > Diff Template... but doesn't work.

Code: [Select]
[+list]
<script>
$(function(){
  $("a[href^=http]").attr({ target:'_blank' });
});
</script>

Everything I open is on the same tab.
Where is the problem?

Thank you.
Title: Re: Web Links in new Window/Tab
Post by: bmartino1 on December 09, 2016, 07:11:51 PM
I tried the code in the root/home icon: Properties > Diff Template... but doesn't work.

Code: [Select]
[+list]
<script>
$(function(){
  $("a[href^=http]").attr({ target:'_blank' });
});
</script>

Everything I open is on the same tab.
Where is the problem?

Thank you.

new tabs are conductive of the browser interpretation

a target="_blank"

usually opens items in a new tab

i believe you will have to add the list to you template (menu > html > edit template > "find list......" ), or other html code...

if you put a different template after the folder, the caring code will not be implemented.

-------------------------------------
example

HFS default template
says hello world

in hfs, i'm sharing folder "A" , "b", "C"


If i right click properties > different template on folder "b", and add html
saying i'm a folder

Then
someone traversing the site would see nothing but "Hello world", they know of  folder "A" and put in that path. They will see the default template witch would say "hello world"

but if they go to b, that template is ignored, and all code form it is not implemented, as such, you see the pre programmed  " i'm folder ..."

------------------

I believe you have a bunch of folders or path that have changed the template, so yo will need to go down the list of where the code stops and add in the code you implement...

i add hfs macro above my own html, so the folder your having a problem with
right lick properties > different template

###########
[+list]
<script>
$(function(){
  $("a[href^=http]").attr({ target:'_blank' });
});
</script>

[body]
<html>
your code here
<html/>