Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the link-title as Linktext with f:link.typolink viewhelper in TYPO3 9.5

I have build a custom content element with a link from field "header_link".

How can I set the title of that link as link text?

In the fluid template I use the link.typolink viewhelperin this way:

<f:link.typolink parameter="{data.header_link}" class="btn btn-primary" />

This results in

<a href="/page" title="link title" class="btn btn-primary">Page Title</a>

How do I set the link title as link text instead of the page title?

like image 515
m4a Avatar asked Dec 17 '22 14:12

m4a


1 Answers

since TYPO3 10.3 it can be done like this

<f:link.typolink parameter="{data.header_link}" class="btn btn-primary" parts-as="parts">
  {parts.title}
</f:link.typolink>

read more in the changelog documentation

these are all the parts u can use

<f:link.typolink parameter="123 _top news title" parts-as="parts">
   {parts.url}
   {parts.target}
   {parts.class}
   {parts.title}
   {parts.additionalParams}
</f:link.typolink>
like image 84
HenryAveMedi Avatar answered Apr 27 '23 16:04

HenryAveMedi