Netresearch Blog

Blog

You can find all the news and insights here. We share our knowledge, give tips and inform you about everything that happens internally and externally at our company.

TYPO3 Flux/Fluid FCEs and problems during subsequent sorting

In our customer projects we have been using Flux, Fluid Pages and Fluid Content since TYPO3 6.2 in order to offer customized page settings and content elements. We have prepared content elements for cross-project use. These include a tab box element and an accordion element, which we often use for customers.

What makes these two elements special is the fact that the number of tabs and accordions can vary. In addition, they can include other TYPO3 content elements such as texts, images, etc.

We use the Flux-Grid Viewhelper for this. This is necessary because a content element in TYPO3 must always be assigned to a “colPos” so that TYPO3 knows where an element should be displayed. The Flux-Grid Viewhelper offers a comfortable way to achieve this. As long as you have a fixed structure, you can manually define the “colPos” for each element. But as soon as the number varies, you have to determine the “colPos” another way.

 Below, I am going to focus on the tab box element.

Problem when sorting the tabs

For our tab box element, we have previously used the index of the elements to determine the “colPos”. This worked well, since our customers never wanted to rearrange the tabs afterwards. However, for one customer this became necessary, and it was found that the tabs can be moved, but the tab content in the frontend remains in the same place.

Solution: an undocumented function

We tried different solutions, but none of them gave the desired result. If I cannot find any documentation while working with TYPO3 and extensions, I’m used to glancing over the code and look at places that might be interesting for a workaround.

During my wanderings, I found what I was looking for relatively quickly. From my previous analysis, I knew that any adjustments must be in the “<flux:form.object>” ViewHelper. This provides the tab, so to speak. First I looked into the documentation but couldn't find anything that would help me. In the ViewHelper code I stumbled across an undocumented option that solves my exact problem:

The description says:

“If true, each object that is created of this type results in a content column of the same name, width and automatic colPos value.”

After activating the option “<flux:form.object name="panel" contentContainer="1">”, each “Tab” object that is created is automatically assigned a “colPos”, which is retained even when the tabs are sorted. Thus, the problem discovered by the customer was solved and I learned something new again.

Conclusion

Once again, this shows that it is always worth taking a look at the code.

Share article:

Latest posts

Two business professionals shake hands in front of a digital world map – symbolizing a partnership in AI sales and digitalization

By Thomas Fleck

Netresearch is a new partner of the Smart Systems Hub

Netresearch is now a partner of the Smart Systems Hub - for more innovation in B2B commerce, AI and…

Read more
Man holding a smartphone, with the text 'Automated Translations in TYPO3' in the foreground, surrounded by floating country flags
By Thomas Schöne

With the TYPO3 extension autotranslate, content is translated automatically and in real time -…

Read more
Header image for the Netresearch blog article: Orange background with the text "Public Interest Technology: TYPO3 now officially recognized as a Digital Public Good." On the right side, a graphic depiction of a stylized globe surrounded by interconnected people – symbolizing global, public good–oriented digitalization.
By Franka Hesse

The Digital Public Goods Alliance has officially recognised TYPO3 as a digital public good. We…

Read more
Netresearch blog article image: “Digitalisation and AI for SMEs – Netresearch joins the Saxony Business Association” – blurred background with two business hands in handshake (suits), featuring a photo of Thomas Fleck, CEO & VP of Sales at Netresearch.
By Thomas Fleck

The future is created where people are empowered and connected. With our commitment to the Saxony…

Read more