简体   繁体   中英

TYPO3 7.6 link a file with typoscript typolink and target?

has someone also this problem: I have a Typoscript Code which generate a Link to a Fileressource. If I add a target = _blank nothing change in frontend. If i Link a page target = _blank is working.

So I think my Typoscript is fine, im able to link to the file. And if I link to a page target = _blank is working. But it seems not possible to have a typolink to a fileressource with target = _blank . I had also tried extTarget and nothing happened.

    renderObj = TEXT
    renderObj.value = || DOWNLOAD || LOW 

    renderObj.value.typolink.parameter.data=file:current:originalUid // file:current:uid
    renderObj.value.typolink.parameter.wrap = file:|

    # this is working:
    # renderObj.value.typolink.parameter=4

    renderObj.value.typolink.target = _blank
    renderObj.value.typolink.ATagParams = || class="download_high" || class="download_low"

I did'nt know the target parameter for the typolink object. I do blank links always this style:

lib.logo = IMAGE
lib.logo {
  file = EXT:theme/Resources/Public/img/logo.jpg
  file {
    height = 43
  }
  stdWrap.typolink.parameter = 1 _blank
}

This generates a link on a page with uid and _blank for new window. Maybe you can add it to your wrap like

renderObj.value.typolink.parameter.wrap = file:| _blank

?

I saw you gave the solution ... AFTER I read and elaborated all, I propose your answer as answer (styled);

renderObj = TEXT
renderObj {
    value = || DOWNLOAD || LOW 
    typolink {
        parameter.data = file:current:originalUid // file:current:uid
        parameter.wrap = file:|
        fileTarget = _blank
        ATagParams = || class="download_high" || class="download_low"
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM