phptypo3extbasetypo3-8.xflexform

Typo3 8.7.15 Flexform: displayCond on field pages (record storage page)


Is there a way to show my flexform field only when a record storage page is defined? I tried the following, but I got an error:

   <settings.view.type>
       <TCEforms>
           <displayCond>FIELD:pages:REQ:true</displayCond>
....

-> Flex form displayCond on field "settings.view.type" on flex form sheet "sDEF" references a field or field / sheet combination "pages" that might be defined in given data structure but is not found in data values.


Solution

  • Try prefixing the fieldname with: parentReq.

    This will then access the parent database record instead of the FlexForm data:

    <settings.view.type>
        <TCEforms>
            <displayCond>FIELD:parentRec.pages:REQ:true</displayCond>
            ...
        </TCEforms>
    </settings.view.type>