Skip to end of banner
Go to start of banner

How to chose your Template Engine

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Template Engine: A flexible Template Engine with client & server mode

Your front-end templates should be able to get rendered both in your server or in JavaScript (or TypeScript) without pain. So the last banner template you did for the home page can be easily re-used for an overlay appearing before the visitor exits the page.

Also, a template engine with a minimum capacity for processing logic (e.g.: formatting strings, conditional parameters, etc.) will facilitate your templates to have the required rendering logic built-in, avoiding the need to have any business logic in your code between the call of Boxalino Narrative API and the rendering in your view.

In addition, Boxalino Template Engines can access directly to your Template Library and manage the displays of overlays throughout the page visit (scroll-behavior, minimum time on page, pause to look at something, etc.) and automate the triggering of calls to Boxalino Narrative API without that you have to program anything while making direct usage of all the templates you have created for your front-end.

Learn more about how a Template Engine is a key part of your future front-end architecture here: Our Best Practice for your New Front-End

Nunjucks

Seems like a quite good engine with a lot of possibilities to create functions and other logic which would make the templates possibly quite autonomous and could therefore be easily re-used as provided (with the required logic inside) for client-side rendering.

https://mozilla.github.io/nunjucks/

Mustache

Nice, but too simplistic as it doesn’t provide any real options to manipulate the data in the rendering (even for simply number formatting).

https://mustache.github.io/

Resource

https://colorlib.com/wp/top-templating-engines-for-javascript/

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.