Skip to content
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

Q: how to make condition without the element itself? #359

Closed
bapcyk opened this issue Nov 5, 2022 · 1 comment
Closed

Q: how to make condition without the element itself? #359

bapcyk opened this issue Nov 5, 2022 · 1 comment

Comments

@bapcyk
Copy link

bapcyk commented Nov 5, 2022

Hello, it's a question (not a bug).

I have an another template engine which support something like (XML):

%IF(IS_LINUX)%
<a ..../>
<b .../>
<c .../>
%ENDIF%

How can I do the same in Chameleon? As I understand something like:

<some tal:condition="IS_LINUX">
  <a ..../>
  <b .../>
  <c .../>
</some>

will be translated to XML:

<some>
  <a ..../>
  <b .../>
  <c .../>
</some>

when IS_LINUX, ie, <some> will be presented in the result? Right? Is it possible to have such a conditional block without to keep the element with tal:condition in the result?

@malthe
Copy link
Owner

malthe commented Nov 5, 2022

Use tal:omit-tag="" or use <tal:some condition="IS_LINUX" />.

@malthe malthe closed this as completed Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants