All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

External links

From TYPO3Wiki
Jump to navigation Jump to search
Content Type: HowTo.

Marking external links with an image or descriptive text is usually considered good behaviour usability-wise. In some countries it may even be required by law to mark external links. There is an extension in the TER ('dh_linklayout') which does this, but it is quite outdated and I did discover some bugs with it. But you can achieve the same yourself.


Copy&Paste the following code to your TypoScript Template Setup:

# Mark external links with an image {
  typolink.parameter.append = LOAD_REGISTER
  typolink.parameter.append {
    isExternal {
      cObject = TEXT
      cObject { = parameters:allParams
        typolink.returnLast = url
      split {
        token = :
        cObjNum = 1||2
        1 = TEXT
        1.current = 1
  outerWrap.cObject = CASE
  outerWrap.cObject { = register:isExternal
    default = TEXT
      default.value = <img class="linkIntImg" src="fileadmin/system/templates/res/link_int.gif" alt="[Internal]" title="Internal link" /> |
    http = TEXT
      http.value = <img class="linkExtImg" src="fileadmin/system/templates/res/link_ext.gif" alt="[External]" title="External link" /> |
    mailto = TEXT
      mailto.value = <img class="linkMailImg" src="fileadmin/system/templates/res/link_mail.gif" alt="[E-Mail]" title="Write an email" /> |
# Copy the above function to other important places {
  typolink.parameter.append <
  outerWrap <

Credits and many thanks go to JoH for writing this TypoScript!