Skip to main content
Topic: 2.0: mustache template engine?  (Read 9202 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: 2.0: mustache template engine?

Reply #30

To all the suggestions of 'but it just changes the syntax', respectfully, you've all missed the point.

Yes, it changes one syntax for another. Most importantly it forces you to not have complex logic in the template, which is a good thing. Because complex logic has no place in the template.

Additionally, it means that anyone who wants to put in some tracking HTML or some other kind of HTML can just copy/paste it without having to futz around working out the correct quoting; to hardened programmers this is a triviality if annoying - but the majority of consumers (both in SMF and Elkarte terms) are not hardened programmers. They're regular people who run a forum who just want to be able to put their thing in and have it work without it being a problem.

I won't pretend it isn't a lot of work - it is a lot of work to do the conversion. I should know whistle

But I think the net result is worth it.

Re: 2.0: mustache template engine?

Reply #31

Looks to me like each template block is a separate file. /me likes that  :)
LiveGallery - Simple gallery addon for ElkArte

Re: 2.0: mustache template engine?

Reply #32

It's a separate file so you can just globally say 'I want this template' regardless of where it might otherwise be located. It also makes you think about some of the 'clever' logic that SMF did where templates sometimes got repurposed or templates were chunks of if (condition) echo 'bunch of stuff' elseif (condition) echo 'different bunch of stuff' which really should have been separate templates.