rejetto forum

Open in new window code for file system.

fPortal · 19 · 5013

0 Members and 1 Guest are viewing this topic.

Offline fPortal

  • Occasional poster
  • *
    • Posts: 14
    • View Profile
I have been looking and cannot find this.
On my file system, I have my lists of folders and files, but I have a link as well.  Is there a way to make that link open in a new window like with a target command?


Offline fPortal

  • Occasional poster
  • *
    • Posts: 14
    • View Profile
Nevermind, I found a way in the template file.

Thank you anyway.


Offline chthonic

  • Tireless poster
  • ****
    • Posts: 121
  • I own the copyright to this image... "Back Off!"
    • View Profile
I was trying to locate the code I was given before for the same thing and I cant find my original post anywhere!.. would you mind sharing how you did it?

it would be greatly appreciated


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13304
    • View Profile
mmm, i think this behavior should be included in the default template.

if no one disagrees with this, i will just go this way.


Offline chthonic

  • Tireless poster
  • ****
    • Posts: 121
  • I own the copyright to this image... "Back Off!"
    • View Profile
LOL hi rejetto!


it would be a very useful thing.... even tho I searched the template code and made manual changes... it was still a bit of a task.. to make sure I didnt mess anything else up.

this would also prevent users from accidentally navigating away from the host site


Offline r][m

  • Tireless poster
  • ****
    • Posts: 347
    • View Profile
Quote
mmm, i think this behavior should be included in the default template
Would be OK, but it can be done when setting url for link in vfs like:
Code: [Select]
http://www.google.com/"target=blank"


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13304
    • View Profile
this test should be ok to detect URLs outside hfs

check url for "://" and not (%host% or %ip%)

in template macros translates to

{.and| {.pos|://|%item-url%.} | {.not|{.pos|%host%|%item-url%.}{.pos|%ip%|%item-url%.}.}


Offline chthonic

  • Tireless poster
  • ****
    • Posts: 121
  • I own the copyright to this image... "Back Off!"
    • View Profile
I just added the target=_blank to the two sections in terayon 1.3.2 that handle URL's

as I said.. had to be very careful and make sure I wasnt messing up other links

having this be a default function is less hassle


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
There are also many cases where we dont want that a link opens a new browserwindow. If the user want's to open the link in a new window or tab, he can already do so rightclicking on the link.
your computer has no brain - use your own !


Offline chthonic

  • Tireless poster
  • ****
    • Posts: 121
  • I own the copyright to this image... "Back Off!"
    • View Profile
that's why they are called "options"

one could be to open in a new window.. another could be to force it to open in a frame and keep it on the same site with navigation.. that way you can view the external and still not leave the HFS server.

I use picture galleries because 250+ images load faster than if I used the thumbnail generator for the template... as a result.. its less hassle for those to open as a new window.

it's a simple matter regarding "ease of use"

I have several people asking me how to setup HFS and stunnel etc... more than willing to show them how.. but they aren't as computer technical as I am.. so they need easier options.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13304
    • View Profile
There are also many cases where we dont want that a link opens a new browserwindow. If the user want's to open the link in a new window or tab, he can already do so rightclicking on the link.

ok. you suggest it is not good that we do it always (by default) ?

i will delay this thing so that we can decide for the better.
maybe an option in the gui is the correct solution.
a global option, or inside the link itself.
unsure.
« Last Edit: March 10, 2009, 12:00:58 AM by rejetto »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13304
    • View Profile
Would be OK, but it can be done when setting url for link in vfs like:
Code: [Select]
http://www.google.com/"target=blank"

very nice workaround!


Offline chthonic

  • Tireless poster
  • ****
    • Posts: 121
  • I own the copyright to this image... "Back Off!"
    • View Profile
make it an option in the gui.. that way we can decide on a per link basis.. something like...

option1: default = open in same window
option2: open in new tab
option3: open in new window

with additional option to make it the default behavior ... which can be over-ridden by custom link settings such as...

LINK OPTIONS: then can choose how that particular link works

« Last Edit: March 10, 2009, 12:30:28 PM by chthonic »


Offline Kremlin

  • Tireless poster
  • ****
    • Posts: 137
    • View Profile

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13304
    • View Profile
there's nothing i can do to decide to open in tab or window.
this depends on the browser.
i guess a flag "open in new window" in the link properties is a good solution.

r][m solution is good, but cannot be thought as general solution for the masses.