TYPO3 Logo
TypoScript Explained
Options
Give feedback View source How to edit Edit on GitHub Full documentation (single file)

TypoScript Explained

About TypoScript

  • Introduction
  • Getting started
    • Quick overview
    • First steps
    • Page
    • Content records
    • Create a menu with TypoScript
    • fluid_styled_content
    • TypoScript objects
      • Objects executing database queries
      • Objects rendering content
      • Further objects
    • TypoScript functions
      • stdWrap
      • getText / data
      • imgResource
      • select
      • split
      • if
      • typolink
      • parseFunc
    • Next steps
  • Usage
    • TypoScript in Sites
    • TypoScript in Extensions
    • Backend Module
    • Access TypoScript in an extension
    • Constants
    • Register
    • Debugging / analyzing
  • Using and setting TSconfig
    • Setting page TSconfig
    • Setting user TSconfig
    • Conditions
    • PHP API
  • Syntax
    • Identifiers
    • Code blocks
    • Operators
    • Comments
    • Conditions
    • File imports
    • String formats
    • TSconfig differences

Frontend TypoScript

  • Page
    • PAGE Examples
  • Content Objects (cObject)
    • Content objects (general information)
    • CASE
    • Content object array - COA, COA_INT
    • CONTENT
    • EXTBASEPLUGIN
    • FILES
    • FLUIDTEMPLATE
    • HMENU
      • TMENU
        • TMENUITEM
    • IMAGE
      • GIFBUILDER
        • Examples
        • Colors in TypoScript GIFBUILDER
        • Note on (+calc)
        • Properties
        • GIFBUILDER objects
          • ADJUST
          • BOX
          • CROP
          • EFFECT
          • ELLIPSE
          • EMBOSS
          • IMAGE
          • OUTLINE
          • SCALE
          • SHADOW
          • TEXT
          • WORKAREA
    • IMG_RESOURCE
    • LOAD_REGISTER
    • PAGEVIEW
    • RECORDS
    • RESTORE_REGISTER
    • SVG
    • TEXT
    • USER and USER_INT
  • Data processors
    • comma-separated-value
    • database-query
    • files
    • flex-form
    • gallery
    • language-menu
    • menu
      • Browse
      • Categories
      • Directory
      • Keywords
      • Language
      • List
      • Rootline / Breadcrumb
      • Updated
      • Userfunction
    • page-content
    • record-transformation
    • site
    • site-language
    • split
    • Custom data processors
  • Config
  • Top-level objects
    • page & config
    • module
    • plugin
    • Reserved top-level objects
  • Functions
    • cache
    • Calc
    • Data / getText
    • encapsLines
    • getEnv
    • HTMLparser
    • HTMLparser_tags
    • if
    • imageLinkWrap
    • imgResource
    • makelinks
    • numberFormat
    • numRows
    • optionSplit
    • parseFunc
    • replacement
    • round
    • select
    • split
    • stdWrap
    • strPad
    • tags
    • typolink
    • Wrap
  • Conditions

Backend TypoScript

  • Page TSconfig Reference
    • colorPalettes
    • mod
      • SHARED
      • web_info
      • web_layout
        • Backend layouts
      • web_list
      • web_view
      • wizards
    • options
    • RTE
    • TCAdefaults
    • TCEFORM
    • TCEMAIN
    • templates
    • tx_*
  • User TSconfig reference
    • admPanel (EXT:adminpanel)
    • auth
    • options
    • page
    • permissions
    • setup
    • TCAdefaults
    • tx_*

Appendix

  • PHP and TypoScript
  • Glossary
  • Sitemap
  1. TypoScript Explained
  2. Getting started
  3. TypoScript functions
  4. typolink
Give feedback Edit on GitHub

typolink

typolink is the TYPO3 CMS function that allows us to generate all kinds of links. If possible one should always use this function to generate links as they will be processed by TYPO3 CMS. This is a prerequisite, for example, for the anti-spam protection of email addresses.

Please resist the urge to a straight <a href="...">...</a> construct in your TypoScript and Fluid templates.

Basically typolink links the specified text according to the defined parameters. One example:

temp.link = TEXT
temp.link {

  # This is the defined text.
  value = Example link

  # Here comes the typolink function.
  typolink {

    # This is the destination of the link...
    parameter = http://www.example.com/

    # with a target ("_blank" opens a new window)...
    extTarget = _blank

    # and add a class to the link so we can style it.
    ATagParams = class="linkclass"
  }
}
Copied!

The example above will generate this HTML code:

<a href="http://www.example.com/" target="_blank" class="linkclass" rel="noreferrer">Example link</a>
Copied!

typolink, in a way, almost works like a wrap: the content which is defined for example by the value property, will be wrapped by the HTML anchor tag. If no content is defined, it will be generated automatically. With a link to a page, the page title will be used. With an external URL, the URL will be shown.

The above example can actually be shortened, because the parameter property can take a series of values separated by a white space:

temp.link2 = TEXT
temp.link2 {

  # Again the defined text.
  value = Example link

  # The parameter with the summary of the parameters of the first
  # example (explanation follows below).
  typolink.parameter = www.example.com _blank linkclass
}
Copied!

The exact syntax for parameter property is fully described, as usual, in the TypoScript Reference.

It is even possible to define links that open in JavaScript popups:

temp.link3 = TEXT
temp.link3 {

  # The link text.
  value = Open a popup window.

  stdWrap.typolink {
    # The first parameter is the page ID of the target page,
    # second parameter is the size of the popup window.
    parameter = 10 500x400

    # The title attribute of the link.
    title = Click here to open a popup window.

    # The parameters of the popup window.
    JSwindow_params = menubar=0, scrollbars=0, toolbar=0, resizable=1

  }
}
Copied!
  • 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: Apr 25, 2025 15:36

© since 2012 by the TYPO3 contributors
  • Legal Notice
  • Privacy Policy
OSZAR »