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

Nested conditioning skin markup behaves weirdly #6818

Closed
jfcherng opened this issue Jun 23, 2019 · 5 comments
Closed

Nested conditioning skin markup behaves weirdly #6818

jfcherng opened this issue Jun 23, 2019 · 5 comments

Comments

@jfcherng
Copy link
Contributor

jfcherng commented Jun 23, 2019

Environment

  • RC: official git repo here, master branch
  • PHP: both 5.6.40 and 7.4.0-dev are tested with the same results

Problem

Since I don't see a note in Wiki that RC's skin markup does not allow doing this common template feature, I consider this as a bug.

image => outputs A C (Good)

image => outputs D (Bad, should be B C)

image => outputs B C D (Bad, should be D)

image => outputs B C D (Bad, should be D)

Reproducer

I replace the whole skins/elastic/templates/login.html with the following codes and visit the login page to do above tests.

<roundcube:if condition="0" />
	<roundcube:if condition="0" />
		A
	<roundcube:else />
		B
	<roundcube:endif />
		C
<roundcube:else />
	D
<roundcube:endif />
@alecpl
Copy link
Member

alecpl commented Jun 24, 2019

This is indeed a limitation of our template engine. We should document that. Fixing this is not trivial and also not a high prio.

@alecpl alecpl added this to the later milestone Jun 24, 2019
@alecpl alecpl modified the milestones: later, 1.5-beta Jul 6, 2019
@roundcube roundcube deleted a comment from PrachiChi Jul 11, 2019
@roundcube roundcube deleted a comment from PrachiChi Jul 11, 2019
jfcherng added a commit to nthu-ee/webmail-roundcube-skins that referenced this issue Jul 31, 2019
@vaso123
Copy link

vaso123 commented Oct 18, 2019

This is a must have feature. Maybe that could be an option, if you should tag your condition with a name.

For example:

<roundcube:if condition="config:something_enabled=='1'" name="something" />
Say something here
    <roundcube:if condition="config:anything_enabled=='1'" name="anything" />
        Say anything here
    <roundcube:endif name="anything" />
    More something
<roundcube:endif name="something" />

It is insane that now I feel this template engine is good for nothing, and I always should use objects, mixing languages and do the HTML output from PHP.

@vaso123
Copy link

vaso123 commented Oct 18, 2019

Ok guys, the best way is if you compelety change the roundcube engine. Absolutelly unusable.

Here is my solution.

https://github.com/vaso123/Twiggy/blob/master/twiggy.php

Use twig. My example of course only a skeleton, but you can improve it.

@jfcherng
Copy link
Contributor Author

jfcherng commented Oct 19, 2019

Personally I like Twig's functionality (but not it's syntax) since I have used it in several (Slim/Symfony) projects. But I don't think it would be used in official RC because it will just break every existing skin, which is a big BC break imo.

@alecpl
Copy link
Member

alecpl commented Jan 5, 2020

Fixed.

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

No branches or pull requests

3 participants