Templates

Hierarchy

Reuse for customization

The main template serves as the foundation layout, while the subtemplate offers supplementary or modified sections. This arrangement enables customization by substituting or extending content from the main template with corresponding files in the subtemplate.

Files

In the templates directory, the base template serves as a foundation. Duplicate the DEMO subtemplate, rename it, and access yourserver.com/admin/template after login to set it as the active subtemplate. Copy necessary files from the base template to the subtemplate for customization.

Each plugin can have its own template folder containing specific templates. Templates can include a plugins folder, allowing for the customization of templates from plugins to match the website's overall appearance.

Code

Below is a code that returns basic.php from the actions directory within the subtemplate if available; otherwise, it will load it from the same directory in the main template.

\Ivy\Template::file('actions/basic.php')

Below is a code that returns buttons.php from the plugins directory within the subtemplate if available; otherwise, it will load it directly from the plugin.

\Ivy\Template::file(_PLUGIN_PATH . "DarkMode/template/buttons.php");