Theme Folder Structure
Plugins are stored in src/Themes/ folder (be careful, folder name is case sensitive). Subsequent folders represent themes. This means that all files of a single theme are located in a single folder. In the example below you can see the location of top folder for the theme called MyFirst.
ROOT/
src/
Themes/
MyFirst/
[ThemeFilesAndFolders]
Each theme folder must have following required sub-folders and files (be careful, all folder and file names are case sensitive):
ROOT/
src/
Themes/
MyFirst/
Assets/
/css
/fonts
/images
/js
Layouts/
... .php files for each layout
Templates/
Plugins/
... .twig files for each plugin
404.twig
maintenance.twig
Main.php
Main.php
Each theme must contain the Main.php (case sensitive) file where the basic configuration of theme is stored. Sample Main.php file may look like this:
<?php
namespace Surikata\Themes;
class MyFirst extends \Surikata\Core\Web\Theme {
public function getDefaultColorsAndStyles() {
return [
"themeMainColor" => "#17C3B2",
"themeSecondColor" => "#222222",
"themeThirdColor" => "#FE6D73",
];
}
}
For more detailed documentation of methods and classes available to use please refer to the \Surikata\Core\Web\Theme source code documentation.
Assets
This sub-folder contains all assets of your theme. This are usually CSS, Javascript or image files but can be anything else you need, like videos, PDF files, etc.
Read more in Working with assets chapter.
Layouts
You can define your page layouts in this folder. Each theme can have unlimited number of layouts but must have at least one. Without such layout it won't be possible to attach a design to a particular page (or to a particular URL).
Read more in Understanding layouts chapter.