Render a url as link with url itself as link text in typoscript

1.3k Views Asked by At

How to render a url as hyper link with typoscript?

Typoscript:

    20 = TEXT
    20.field = email
    20.Wrap = <span><a href="mailto: | " >Link text</a></span>

Above typoscript gives me the HTML output

    <a href="mailto:email" >Link text</a>

I want email it self in the place of Link text. How to achieve this?

2

There are 2 best solutions below

0
On BEST ANSWER

Problem solved myself... :)

    20 = TEXT
    20.dataWrap = <span><a href="mailto:{field:email}" >{field:email}</a></span>
0
On
20 = TEXT
20.typolink.parameter.field = email

This code will wrap your field with the standard typolink function. If an "@" is found, typo3 will wrap it as an email-address.

This solution will parse your address with the useful typo3 spam email protection