• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RM 1.1 Open external download link in new tab ?

#1
Greetings,
I have some resources that are uploaded elsewhere, so the Download via external site button is present. Problem is that when clicking the button it follows in the same tab/window. So after the download is finished, unless user clicks the back button, he is gone.
How could I modify the behavior so that clicking the Download button opens the link in a new tab ?

Thank you in advance and sorry for the noobish question (I realize that might not even be linked to RM behavior but maybe general web language..)

Lucian.
 
#3
Hate to waste your time, but could you be more specific ? As where do I look for it ? :notworthy:
In Appearance>Styles>My_Style>Templates I have only found one attachment_upload_button and the code is:
Code:
<xen:if is="{$attachmentParams}">

    <xen:require js="js/xenforo/attachment_editor.js" />
    <xen:if is="{$xenOptions.swfUpload} AND {$visitor.enable_flash_uploader}">
        <xen:require js="js/swfupload/swfupload.min.js" />
    </xen:if>   
    <xen:require css="attachment_editor.css" />

    <span id="AttachmentUploader" class="buttonProxy AttachmentUploader"
        style="display: none"
        data-placeholder="#SWFUploadPlaceHolder"
        data-trigger="#ctrl_uploader"
        data-postname="upload"
        data-maxfilesize="{$attachmentConstraints.size}"
        data-maxuploads="{$attachmentConstraints.count}"
        data-extensions="{xen:helper implode, $attachmentConstraints.extensions, ','}"
        data-action="{xen:link 'full:attachments/do-upload.json', '',
            'hash={$attachmentParams.hash}',
            'content_type={$attachmentParams.content_type}',
            'key={$attachmentButtonKey}'}"
        data-uniquekey="{$attachmentButtonKey}"
        data-err-110="{xen:phrase uploaded_file_is_too_large}"
        data-err-120="{xen:phrase uploaded_file_is_empty}"
        data-err-130="{xen:phrase uploaded_file_does_not_have_an_allowed_extension}"
        data-err-unknown="{xen:phrase upload_failed}">
       
        <span id="SWFUploadPlaceHolder"></span>       
           
        <input type="button" value="{xen:if {$buttonText}, {xen:raw $buttonText}, {xen:phrase upload_file}}"
            id="ctrl_uploader" class="button OverlayTrigger DisableOnSubmit"
            data-href="{xen:link full:attachments/upload, '', '_params={$attachmentParams}', 'key={$attachmentButtonKey}'}"
            data-hider="#AttachmentUploader" />
        <span class="HiddenInput" data-name="_xfSessionId" data-value="{$sessionId}"></span>
        <xen:foreach loop="$attachmentParams.content_data" key="$dataKey" value="$dataValue"><span class="HiddenInput" data-name="content_data[{$dataKey}]" data-value="{$dataValue}"></span>
        </xen:foreach>
    </span>

    <noscript>
        <a href="{xen:link 'attachments/upload', '', '_params={$attachmentParams}'}" class="button" target="_blank">{xen:if {$buttonText}, {xen:raw $buttonText}, {xen:phrase upload_file}}</a>
    </noscript>

</xen:if>
 

BassMan

Well-known member
#5
I use it like you want.

Open resource_view_header template.

Find:
Code:
<a href="{xen:link resources/download, $resource, 'version={$resource.current_version_id}'}" class="inner">
Replace:
Code:
<a href="{xen:link resources/download, $resource, 'version={$resource.current_version_id}'}" class="inner" target="blank">