What are templates, and how many templates are there?
It is not good to provide one unified definition of templates in one sentence because there are two types of templates used in the AC framework:
- Templates that are assigned to blocks via Layout XML (or, sometimes, via PHP code)
- Templates that are assigned via
knockout.js
In this chapter, we will only cover the first one, and, as I mentioned in Chapter 4, we can compare them to the interior design of a building.
If I were to provide you with an exact definition of a template from the AC platform, I would summarize it like this: A template is a regular text file containing HTML code and directives (“loops” and “if” statements) specified to render HTML content. Templates should not contain any business logic except for rules that render and define “if” and “loops” statements. Templates control the visual layer of your AC site.
The AC framework uses PHTML...