user2310852
user2310852

Reputation: 1674

FLUX configuration for a typolink

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

Upvotes: 2

Views: 3187

Answers (2)

Daschmi
Daschmi

Reputation: 56

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>

Upvotes: 2

Cedric Ziel
Cedric Ziel

Reputation: 1052

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)

Upvotes: 4

Related Questions