0

I override Templates/Styles/TWB/Templates/Category/List.html to have the category menu behave exactly as the sidebar menu in the introduction package (submenus show only if main is selected).

If I add the static template "News Styles Twitter Bootstrap (news)" I'm almost there, it is not difficult to open the sub-categories only if the main category is selected (I need a massive amount of categories/sub-categories), but it should also be open when a sub is selected:

...
    <f:if condition="{0:category.item.uid,1:category.item.uid} == {0:overwriteDemand.categories,1:category.children.{overwriteDemand.categories}.parent}">
        <f:if condition="{category.children}">
            <f:render section="categoryTree" arguments="{categories: category.children,overwriteDemand:overwriteDemand,class:''}" />
        </f:if>
    </f:if>
...

I do not know how to use {overwriteDemand.categories} as key to match the value ... can anybody point to the proper syntax

update: I tried to apply a custom ViewHelper as this post suggests, but using TYPO3 V7.6.16 got stuck with the error should be compatible with TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper:‌​:render(), so could not try working with the variable overwriteDemand.categories in another way ...

Community
  • 1
  • 1
webman
  • 1,117
  • 15
  • 41

1 Answers1

0

Dynamic access to variables in fluid is just possible since TYPO3 8. Check out the Whats New Slides here: https://typo3.org/download/release-notes/whats-new/ and search for "Dynamic variable name parts" in the PDF.

In TYPO3 7, the "vhs"-Extension provides a ViewHelper to do the same job but nesting a ViewHelper within an complex f:if-condition is even more difficult. If possible, try out TYPO3 8. If it's not possible you may write your own ViewHelper to solve this logical problem.

Paul Beck
  • 2,675
  • 1
  • 12
  • 14
  • Hi paul, The whole site is ready now but I still did not work out this problem, V8 is not an option, but with my own viewhelper I get stuck ... can you give me a pointer ... https://stackoverflow.com/questions/19731150/typo3-fluid-complex-if-conditions looked fine but gives errors ... – webman Jun 25 '17 at 04:19