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

Alternative Templating engines #42

Closed
andrewminton opened this issue Sep 2, 2014 · 7 comments
Closed

Alternative Templating engines #42

andrewminton opened this issue Sep 2, 2014 · 7 comments
Labels

Comments

@andrewminton
Copy link

Loving what I'm reading so far with Grav and think I'd like to use it on a few projects in the near future.

One thing has cropped up that i'd like to know what peoples opinions are on alternative templating engines? Is there scope to swap out Twig for something else if we wished to used a different flavour of constructing our sites maybe?

We use XSLT and XML a lot and it would be great to think some sort of XSLT bridge similar to this: https://github.com/iwyg/xsltbridge which is for Laravel, but could possibly be ported to work with Grav?

Just putting it out there.

@rhukster
Copy link
Member

rhukster commented Sep 2, 2014

I don't think as a project we have any interest in doing an alternative templating engine. I know its a preference thing, but we spent a lot of time looking at all the mainstream alternatives, and Twig was the clear winner for many reasons. Supporting multiple engines at the core level would be lots of work for us to ensure compatibility with everything. It's really nice just having one solid solution.

However, Grav is a fully MIT open source project, and also with the dependency injection, it's possible to change pretty much anything. I would certainly be interested if someone else were able to switch out the templating engine. If you did look into such a thing, and there were some core changes needed to properly support this, we would be open to making that happen also.

Personal opinion though: I remember doing XSLT and XML in the Java world many years ago, and YUCK! :) Why would you want to deal with that when you could use something as lovely and friendly as Twig? :)

@andrewminton
Copy link
Author

Thanks for your response. Its definately a preference thing so if we tookit upon ourselves to swap it out, we'd definately be keen to get peoples input. XSLT is a legacy technology weve used for last 4 years and still find it nice to use so I was just putting it out there.

I commend you also for sticking to your guns in terms of templating choice.. Twig is really nice and easy to grasp and opening up the core to more 'choice' is risky in development terms.

Still love where this project is heading though... congrats.

@mahagr
Copy link
Member

mahagr commented Sep 3, 2014

I have been thinking of extending Grav in this area a bit when I am going to refactor pages to extend the classes we built after creating the Page class. I have no plans to include XSLT (once upon time I was pretty good on it as it was my choice of templating language as well), but I do intend to support at least plain HTML and TXT along a way to plug in something else than twig.

@bobrocke
Copy link

bobrocke commented Sep 5, 2014

I would think that this would be pretty low on the priority stack. Twig works pretty darned well, it looks like.

Maybe Grav 2.0?

@rhukster rhukster closed this as completed Sep 6, 2014
@matthew-dean
Copy link

Twig is kind of terrible, syntax-wise. I prefer something like Foil. http://www.foilphp.it/

But the point is that there's no reason to not make it a developer preference. I mean, why can't Grav allow a theme to use whatever template flavor they like? I don't understand why Grav would even have a horse in this race. As long as a template adapter can expose X method that can receive Y data from Grav, it shouldn't matter. (Same logic applies to YAML and Markdown, but that's a different issue.)

@rhukster
Copy link
Member

Something we're planning for Grav 2.0.

@0x6B386F
Copy link

Support for Latte can be nice. Personally i love it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants