Is life possible without a template engine?

  • Tutorial
The correct answer is yes, easy!

Almost always describing the CleverStyle CMS device, someone had a question, but how to customize the appearance, because there are no templates.
I must admit, I was a little cunning, saying that the appearance can be changed using CSS. You can change something, but not dramatically.
There was no template engine as it was, and it’s not even planned. Instead, BananaHTML is used to generate simple HTML , and the interface itself rests on the shoulders of web components and Polymer in particular.

How I came to such a life

For various reasons, I did not like template engines for a long time. In this regard, CleverStyle CMS has a concept of design theme, which is responsible for the overall appearance of the site, but there are no templates for individual pages.
Firstly, if you make templates for individual pages, you will not support all kinds of modules created by third-party developers, therefore standard templates will be used.
Secondly, templates do not allow you to easily inherit, and at the same time radically change the appearance if necessary (more on this later).

First-class web component support

Web components appeared not so long ago, and there are a lot of nuances with their use, however, they were able to solve.
In this regard, initially a lot of time was spent to understand who is to blame - I, as a developer, polyfill, or even third-party libraries.
It turned out that everybody was to blame periodically.
The current version of CleverStyle CMS is probably the most reliable and, therefore, convenient environment for using web components.
The delivery (at the time of writing) includes patched versions:

  • jQuery: fixed the behavior of $ .fn.offset () for elements inside the shadow tree ( pull request ), fixes the work of tooltips and a whole bunch of other jQuery plugins
  • WebComponents.js: fixed processing of relative paths in css files if there is (pull request)
    UIkit: modified styles for working inside the shadow tree ( Script for conversion, suitable for any style )
    Polymer: patch that allows you to inherit components with the same names ( discussion )

  • Whether you use CleverStyle CMS or not, all patches are open and accessible, so I recommend everyone to try and express their opinion in the comments.
    Web components are the future!

Only registered users can participate in the survey. Please come in.

Do you use web components?

  • 17.7% No, and I'm not going to 41
  • 36.7% No, I will use it when browser support is better than 85
  • 3% Already use, polyfills work quite well 7
  • 42.4% What are O_o Web Components? 98

Also popular now: