DEVELOPER GUIDES

How to make theme:

Setup:

Every theme need have folder and files.

  • inc - folder
    • functions.php - file
    • info.php - file
  • languages - folder
  • maintenance - file (or any different name)
  • 404 - file (or any different name)
  • page_loader - file
  • screen.png - file (the screenshot of the theme)

These folder and file must be in every theme. But we can make other folders and files in the theme. We can structure the theme like we want, we can insert all other pages in a subfolder and make a folder for all the css and images.

File extension:

We can make theme only in html or in php, but also if we want use twig we can.

Only PHP theme

Advantages

  • Use all the php functions and access to all the classes of the cms.
  • Make functions inside every pages.
  • Check different thing and make what we want.

Disadvantages

  • No support for cache.

Only HTML theme

Advantages

  • Is only html, no errors if we use wrong syntax.
  • Use all the cms tags like "{@siteURL@}".
  • If you don't know php or twig, you can easily make a theme only with html.

Disadvantages

  • We can't use php functions.
  • We can't extend a file like twig and make in different files header, footer...
  • No support for cache.

Only TWIG theme

Advantages

  • Support for cache (by twig).
  • Use all function of the cms by accessing to the container who contain all classes.
  • Use all the cms tags or if you want twig tags.
  • Is twig, flexible, fast and secure.

Disadvantages

  • We can't use all php functions.
  • Make new functions.
  • Use much time to make different checks because we need use every time twig brackets.

We can also make a theme with different page extensions, a page in html and another in php...

Next Step - Build our first theme