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

Include templates in conditional sentences #15

Open
lpalomero opened this issue Sep 7, 2012 · 10 comments
Open

Include templates in conditional sentences #15

lpalomero opened this issue Sep 7, 2012 · 10 comments

Comments

@lpalomero
Copy link

Hello, first of all I want to agree you for your Kiwi template engine, it's very good and satisfies most of all needs that I have. This is a great job!

I want to comment you one issue that I'm having with the template engine. In one development I have to to include one javascript file or render it inline according to a variable... and I think that template system crashes.

This is the example code where I've got this issue:

{{if params.presentation._render_inline}}
    <script type="text/javascript">{{include "_mini_framework"}}</script>
{{else}}
    <script type="text/javascript" src="http://xxxxxx/js/mini_framework.js"></script>
{{/if}}

mini_framework.js is a symlink of _mini_framework(.kiwi).

And when I try to execute this code I've got an syntax error at compiler.js file (the trace is SyntaxError: Unexpected token else, at Object.Function (unknown source), at onCompiled (/yyyyyyy/node_modules/kiwi/lib/compiler.js:70:16), )

Is it an issue, the system doesn't have this feature or I'm missing something (it's the most probable)?

Regards,
L.

@pierreis
Copy link
Member

pierreis commented Sep 7, 2012

Hello!

There is, indeed, an issue with include inside block tags (like if). I'm currently in the last steps of fixing this with a new, more powerful, compiler.

Thanks for notifing!

@lpalomero
Copy link
Author

You are wellcome.

I opened this issue because now I'm in a development in which would like to use Kiwi in all its power or use a workaround if simulating. This development will take about a week so would like to know how much time it will cost you to complete the correction using the new version of the compiler. I would try this new compiler.

One think more, when you talk about a new compiler, this new compiler would be a major change or a new "Kiwi2", or it would bee "Kiwi" instead?

Many thanks for everything.

L.

@pierreis
Copy link
Member

pierreis commented Sep 7, 2012

You can expect the update on a testing branch within one week, if everything goes as expected.

@lpalomero
Copy link
Author

This is a good new, but not enough good for me (damned deadlines...). I think that I'll implemenbt the workaround and review your work in two weeks.

@panosru
Copy link

panosru commented Sep 22, 2012

@pierresforge Hello, I was wondering regarding the updated, how it's going? :) any info would help :D

@lpalomero
Copy link
Author

@pierresforge +1 to panosru's question. How it's going?
Thanks!

@bazjapan
Copy link

bazjapan commented Dec 2, 2012

Bump... :) anyone manage to get this going? Would be nice to include templates inside conditionals.
thanks

@bazjapan
Copy link

Has this project been abandoned?

@pierreis
Copy link
Member

Not at all.
Just got hired in a new company. I'll be back on this within a few days.

@bazjapan
Copy link

Thanks for the reply. Much appreciated.

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

4 participants