Question

using Typo3 6.1, I'd like to be able to add a link with an editable caption to the end of each content element, linking to some related page. My approach was to (mis)use the header_link field for that. I removed the typolink from the headline and added the link after the content.

# something like:
20.text.20.append {
  if.isTrue.field = header_link
  value = more...
  typolink.parameter.field = header_link
  wrap = <div class="button">|</div>
}

To be able to use different captions for each link (instead of "more..."), I hoped to use the title property of the typolink since it can easily be set in the backend. Is this possible? Or is there a more reasonable way to achieve this?

Was it helpful?

Solution

The most straightforward way would probably be adding a new link field and a title field for that link by building a custom extension just for that purpose (adding the fields to BE and Database). Then editors can fill in these fields in the same tab and you can access them with typoscript.

OTHER TIPS

You can use COA with new Object

100.value = more
100.wrap = <div class="button">|</div>
100.typolink ...

or use wrapper existing element

stdWrap.typolink {
    wrap = <div class="linkwrap">|</div>
    parameter.insertData = 1
    parameter = {field:header_link}
    ATagParams = class="headerLink"
    ATagBeforeWrap = 1
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top