<conditionalContent>
<conditionalContent>
is a General Operator
component that defines one or more blocks of content that
are evaluated only when certain conditions are met.
Conditions may be defined directly on the <conditionalContent>
tag using the condition
attribute.
Alternatively, one can use one or more <case>
children with an
optional <else>
child.
Attributes and Properties
The <conditionalContent>
component has no attributes or properties.
Example: <conditionalContent>
with nested <case>
children
The <conditionalContent>
component defines a block of content
containing individual <case>
children. The doenetML within
each <case>
is only rendered when its specified condition
is true
.
Example: <conditionalContent>
with nested <else>
The <conditionalContent>
component defines a block of content
containing individual <case>
children. To catch all remaining
cases following a given condition or set of conditions, the
<else>
component may be used.
Attribute Example: condition
A <conditionalContent>
block with a <condition>
attribute
renders only when the condition
is satisfied. This allows for use of
a <conditionalContent>
component without nested <case>
components.