TYPO3 Logo
Fluid ViewHelper Reference
Release: 11.5

Loading data.

  • typo3/backend
    • arrayBrowser
    • avatar
    • languageColumn
    • moduleLayout
    • moduleLink
    • thumbnail
    • link
      • link.editRecord
      • link.newRecord
    • mfa
      • mfa.ifHasState
    • moduleLayout
      • moduleLayout.menuItem
      • moduleLayout.menu
      • button
        • moduleLayout.button.linkButton
        • moduleLayout.button.shortcutButton
    • uri
      • uri.editRecord
      • uri.newRecord
  • typo3/core
    • iconForRecord
    • iconForResource
    • icon
    • normalizedUrl
    • form
      • form.typoScriptConstants
  • typo3/fluid
    • base
    • cObject
    • debug
    • flashMessages
    • form
    • image
    • media
    • render
    • translate
    • asset
      • asset.css
      • asset.script
    • be
      • be.container
      • be.infobox
      • be.link
      • be.pageInfo
      • be.pagePath
      • be.pageRenderer
      • be.tableList
      • be.uri
      • buttons
        • be.buttons.csh
        • be.buttons.shortcut
      • labels
        • be.labels.csh
      • menus
        • be.menus.actionMenuItemGroup
        • be.menus.actionMenuItem
        • be.menus.actionMenu
      • security
        • be.security.ifAuthenticated
        • be.security.ifHasRole
    • debug
      • debug.render
    • form
      • form.button
      • form.checkbox
      • form.hidden
      • form.password
      • form.radio
      • form.select
      • form.submit
      • form.textarea
      • form.textfield
      • form.upload
      • form.validationResults
      • select
        • form.select.optgroup
        • form.select.option
    • format
      • format.bytes
      • format.case
      • format.crop
      • format.currency
      • format.date
      • format.html
      • format.htmlentitiesDecode
      • format.htmlentities
      • format.json
      • format.nl2br
      • format.number
      • format.padding
      • format.stripTags
      • format.urlencode
    • link
      • link.action
      • link.email
      • link.external
      • link.file
      • link.page
      • link.typolink
    • sanitize
      • sanitize.html
    • security
      • security.ifAuthenticated
      • security.ifHasRole
    • transform
      • transform.html
    • uri
      • uri.action
      • uri.email
      • uri.external
      • uri.image
      • uri.page
      • uri.resource
      • uri.typolink
  • typo3fluid/fluid
    • alias
    • case
    • comment
    • count
    • cycle
    • debug
    • defaultCase
    • else
    • for
    • groupedFor
    • if
    • inline
    • layout
    • or
    • render
    • section
    • spaceless
    • switch
    • then
    • variable
    • cache
      • cache.disable
      • cache.static
      • cache.warmup
    • format
      • format.cdata
      • format.htmlspecialchars
      • format.printf
      • format.raw
  • Contribution
  • Sitemap

Contributors Corner

  • View source of current document
  • How to edit
  • Edit current document on GitHub
  1. Fluid ViewHelper Reference
  2. typo3/fluid
  3. link
  4. link.typolink
Report issue View source How to edit Edit on GitHub

Attention

TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.

Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.

Link.typolink ViewHelper <f:link.typolink>

A ViewHelper to create links from fields supported by the link wizard

Example

{link} contains: t3://page?uid=2&arg1=val1#9 _blank some-css-class "Title containing Whitespace".

Or a legacy version from older TYPO3 versions: {link} contains: 9 _blank - "testtitle with whitespace" &X=y.

Minimal usage

<f:link.typolink parameter="{link}">
   Linktext
</f:link.typolink>
Copied!

Output:

<a href="/page/path/name.html?X=y" title="testtitle with whitespace" target="_blank">
   Linktext
</a>
Copied!

Depending on current page, routing and page path configuration.

TextWrap usage

<f:link.typolink parameter="123" textWrap="<span>|</span>"/>
Copied!

Output:

<a href="/some/page">
   <span>Page title of some page wrapped in span</span>
</a>
Copied!

Depending on current page, routing and page path configuration.

Full parameter usage

<f:link.typolink parameter="{link}" additionalParams="&u=b"
    target="_blank"
    class="ico-class" title="some title"
    additionalAttributes="{type:'button'}"
>
   Linktext
</f:link.typolink>
Copied!

Output:

<a href="/page/path/name.html?X=y&u=b" title="some title" target="_blank" class="ico-class" type="button">
    Linktext
</a>
Copied!

Depending on routing and page path configuration.

Source code

Go to the source code of this ViewHelper: TypolinkViewHelper.php (GitHub).

Arguments

The following arguments are available for <f:link.typolink>:

Name Type Default
parameter
string
target
string
class
string
title
string
language
string
additionalParams
string
additionalAttributes
mixed array ()
addQueryString
boolean
addQueryStringMethod
string
addQueryStringExclude
string
absolute
boolean
parts-as
string 'typoLinkParts'
textWrap
string

parameter

parameter
Type
string
Required

true

StdWrap.typolink style parameter string

target

target
Type
string

Define where to display the linked URL

class

class
Type
string

Define classes for the link element

title

title
Type
string

Define the title for the link element

language

language
Type
string

Link to a specific language - defaults to the current language, use a language ID or "current" to enforce a specific language

additionalParams

additionalParams
Type
string

Additional query parameters to be attached to the resulting URL

additionalAttributes

additionalAttributes
Type
mixed
Default
array ()

Additional tag attributes to be added directly to the resulting HTML tag

addQueryString

addQueryString
Type
boolean

If set, the current query parameters will be kept in the URL

addQueryStringMethod

addQueryStringMethod
Type
string

This argument is not evaluated anymore and will be removed in TYPO3 v12.

addQueryStringExclude

addQueryStringExclude
Type
string

Define parameters to be excluded from the query string (only active if addQueryString is set)

absolute

absolute
Type
boolean

Ensure the resulting URL is an absolute URL

parts-as

parts-as
Type
string
Default
'typoLinkParts'

Variable name containing typoLink parts (if any)

textWrap

textWrap
Type
string

Wrap the link using the typoscript "wrap" data type

  • Previous
  • Next
Reference to the headline

Copy and freely share the link

This link target has no permanent anchor assigned. You can make a pull request on GitHub to suggest an anchor. The link below can be used, but is prone to change if the page gets moved.

Copy this link into your TYPO3 manual.

  • Home
  • Contact
  • Issues
  • Repository

Last rendered: Oct 16, 2024 07:43

© since 2018 by the TYPO3 contributors
  • Legal Notice
  • Privacy Policy