jensjeflensje / websk

Create websites using Skript!
MIT License
9 stars 4 forks source link

[ADDITION] 'If' condition inside a template file #5

Closed ItsTheSky closed 2 years ago

ItsTheSky commented 2 years ago

Hello 😄 Why not add (if it's not already here) a sort of if / else condition in the template file directly? If the condition pass, then the HTML code will be shown, else it will be the other HTML code:

Example

%if {_var} is true%
<h1>Condition passed!</h1>
%else%
<h1>Condition not passed!</h1>

It can moreover be done easily using Condition#parse from Skript ^^

jensjeflensje commented 2 years ago

Hi, first of all, thanks for the suggestion. I actually almost abandoned this project, because I couldn't get anyone to notice it.

I'm planning on using mustache templating for this project, that also includes if and else statements. My own implementation wasn't that good.

ItsTheSky commented 2 years ago

Why not even add a configurable surrounding (%%, {{}}, <?sk ?>, etc...) ?

ItsTheSky commented 2 years ago

Fixed in #15