2
votes

How can I use a typolink-field at my FLUX Flexform-Configuration (Backend)

<f:section name="Configuration">
  <flux:form id="home" options="{icon: 'Icons/Content/myicon.gif', group: 'Homepage'}">
  <flux:field.input name="txtHeadline" label="Headline" />

  <!-- ?? -->
  <flux:field.input name="lnkTarget" label="Link">
     <flux:wizard.link />
  </flux:field.input>

  </flux:form>
</f:section>

Main Section:

{namespace v=Tx_Vhs_ViewHelpers}
...
<v:link.typolink parameter="{parameter: section.item.url}">Beautiful link</v:link.typolink>

<!-- or -->
<v:uri.typolink parameter="{parameter: section.item.url}" />

That's my first steps with FLUID Powered TYPO3 and I have no idea? Thanks for your help. I need this input field and the link wizard for the 'normal' output: <a href="mylink" class="xy" />

enter image description here

2
It is not quite clear what you are asking. You have posted all the relevant code snippets, and the only problem I see is the wrong usage of the v:(uri|link).typolink-viewhelpers. It should be <v:link.typolink configuration="{parameter: lnkTarget}">Linktext</v:link.typolink>, similar for the v:uri.typolink viewhelper.Jost
Hi Jost, thanks for your comment. I've got all together, but little things were wrong ..user2310852

2 Answers

4
votes

Jost is right. You need to pass the value from the field to the TypoLink ViewHelper from VHS.

Being partially compatible with the TYPO3 CMS Core typolink function, you need to pass your field value as parameter.

Having a form field like:

<flux:field.input name="lnkTarget" label="Link">
     <flux:wizard.link />
</flux:field.input>

Example with the plain contents of a field:

<v:link.typolink configuration="{parameter: lnkTarget}" />

Example with custom overrides/additions to the field value:

<v:link.typolink configuration="{parameter: lnkTarget, additionalParams: '&print=1', title: 'Follow the link'}">
  Click Me!
</v:link.typolink>

Notice where I placed {lnkTarget}.

You can look those up in the DocComent Block on the ViewHelpers:

Being one of the maintainers, if you need further feedback-please raise an issue on the Github project if you have problems using it or join us on IRC (#fedext on Freenode)

0
votes

Now in 2021 (Typo3 10) use:

<flux:field.input name="linktarget" label="Link" config="{renderType: 'inputLink'}"></flux:field.input>

And

<f:link.typolink parameter="{parameter: d.job.linktarget}">Click Me!</f:link.typolink>