-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Archetype: add support for conditional blocks #747
Comments
If I understand the enhancement correctly, today it works this way: <output>
<model>
<list key="foo" if="bar">
<value>foo</value>
</list>
<list key="foo1" if="bar">
<value>foo1</value>
</list>
</model>
</output> and we want to do this: <output>
<model>
<condition if="bar">
<list key="foo">
<value>foo</value>
</list>
<list key="foo1">
<value>foo1</value>
</list>
</condition>
</model>
</output> |
Yes. It would be nicer though if we were able to have |
Okay, so I can think of two options: <output>
<model>
<if expr="bar">
<list key="foo">
<value>foo</value>
</list>
<else/>
<list key="foo1">
<value>foo1</value>
</list>
</if>
</model>
</output> or <output>
<model>
<if expr="bar">
<list key="foo">
<value>foo</value>
</list>
</if>
<else>
<list key="foo1">
<value>foo1</value>
</list>
</else>
</model>
</output> |
The 2nd one is better, though the XML reader will be a bit tricky. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add a conditional block to group blocks that are nested with the nested condition.
This will help to avoid repeating the same condition on consecutive blocks.
The text was updated successfully, but these errors were encountered: