Themes
Siteman ships with a default BlankTheme, which is not very exciting. But you can easily create your own theme by executing php artisan make:siteman-theme. This will create a new theme in the App\Themes namespace of your application alongside some basic views to kickstart your theme development.
The theme can be enabled via your config/siteman.php file.
return [
// ...
'themes' => [
\Siteman\Cms\Theme\BlankTheme::class,
],
// ...
];A Siteman theme is a PHP class which implements the Siteman\Cms\Theme\ThemeInterface. It defines two methods:
getName method
The getName method is used to return a human-readable name of the theme.
configure method
The Themes configure method is used to define the theme's configuration. It gets the Siteman\Cms\Siteman instance as a dependency, which allows for easy access and manipulation of the Siteman configuration.
IMPORTANT
If you are proving a theme via a composer package you need to implement a getViewPrefix method.
Default view files
Siteman renders different content through different cascades of view options. The first existing one is taken.
- Pages
- Layout if set on the Page
{theme}.pages.{slug}{theme}.pages.showsiteman::themes.blank.pages.show
- Posts
{theme}.posts.{slug}{theme}.posts.showsiteman::themes.blank.posts.show
- Post Index
{theme}.posts.indexsiteman::themes.blank.posts.index
- Tags
{theme}.tags.{slug}{theme}.tags.showsiteman::themes.blank.tags.show