Open external url in a new tab/window

  • App
    WoltLab Suite Filebase

    How can I get "external url" links to open in a new tab/window?



    edit: mod, please move this to the appropriate forum. Thanks.

    Edited once, last by Keith65 ().

  • I see. I do not have access to the filebase, but there should be a template called "file" or something which you can edit.

    You have to find the part that looks like this:

    <a href="{FILEBASE CONTROLLER STUFF}" class="button buttonPrimary">

    and change it to something like:

    <a href="{FILEBASE CONTROLLER STUFF}" class="button buttonPrimary" {if EXTERNALURL}target="_blank"{/if}>


    {FILEBASE CONTROLLER STUFF} is the link/file/download definition which i don't know how it looks like.

    {if EXTERNALURL} must be replaced with the correct if-statement which should also be somewhere below these lines since the template changes if its an external URL download.

    ~ DMedia

  • In addition to DMedia answer, the condition is {if $file->getLastVersion()->isExternalURL()}. On around LINE 86 of the file template, you can see this code:

    HTML
    <a href="{link application='filebase' controller='Download' id=$file->lastVersionID}{/link}" class="button buttonPrimary">

    You need to replace that code with:

    HTML
    <a href="{link application='filebase' controller='Download' id=$file->lastVersionID}{/link}" class="button buttonPrimary"{if $file->getLastVersion()->isExternalURL()} target="_blank"{/if}>

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!