Skip to content

Commit 1698a13

Browse files
authored
[TASK] Mention displayCond's work for FlexForm sheets too (#6061) (#6062)
1 parent e5c89f5 commit 1698a13

File tree

1 file changed

+29
-4
lines changed
  • Documentation/ApiOverview/FlexForms/Definition

1 file changed

+29
-4
lines changed

Documentation/ApiOverview/FlexForms/Definition/Index.rst

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,16 @@ How this looks when configuring the plugin:
118118
.. index:: FlexForms; Display conditions
119119
.. _flexformDisplayCond:
120120

121-
Display fields conditionally (displayCond)
122-
------------------------------------------
121+
Display fields/sheets conditionally (displayCond)
122+
-------------------------------------------------
123123

124124
Some settings may only make sense in the context of other settings.
125125
For example, in one setting you define a sorting order (by date, title etc.)
126126
and all sort orders except "title" have additional settings. These
127127
are only visible if sort order "title" is not selected.
128128

129-
You can define conditions using displayCond. This defines
130-
whether a setting should be displayed when the plugin is configured.
129+
You can define conditions using displayCond. This defines whether a setting or
130+
sheet should be displayed when the plugin is configured.
131131
It can depend on one or more settings in the FlexForm,
132132
on database fields in the current record or be defined by a user function.
133133

@@ -139,6 +139,31 @@ on database fields in the current record or be defined by a user function.
139139
<!-- Hide field if value of neighbour field "settings.orderBy" on same sheet is not "title" -->
140140
<displayCond>FIELD:settings.orderBy:!=:title</displayCond>
141141
142+
.. code-block:: xml
143+
144+
<sheets>
145+
<sheetA>
146+
<ROOT>
147+
<sheetTitle>Sheet A</sheetTitle>
148+
<el>
149+
<settings.foo>
150+
...
151+
</settings.foo>
152+
</el>
153+
</ROOT>
154+
</sheetA>
155+
<sheetB>
156+
<ROOT>
157+
<sheetTitle>Optional sheet B</sheetTitle>
158+
<!-- Hide entire sheet if value of field "foo" on neighboring sheet is not "bar" -->
159+
<displayCond>FIELD:sheetA.settings.foo:=:bar</displayCond>
160+
<el>
161+
...
162+
</el>
163+
</ROOT>
164+
</sheetB>
165+
</sheets>
166+
142167
Again, the syntax and available fields and comparison operators is documented
143168
in the TCA reference:
144169

0 commit comments

Comments
 (0)