Introduced in v1.3.0
A theme is a collection of files that works together to create the design and add functionality to your site.
- It separates the styles and templates from the system files so the site will upgrade without drastic changes to the visual presentation of the site.
- Allows customizing the look and feel of the website.
- Allows to quickly change from theme to theme.
Themes are based on namespaces, it’s just a fancy word to describe “sections” of your website. Junker has 3 theme namespaces so far:
||The main public area of the website.|
||The administration area of the website.|
Each namespace has their own set of template files.
Base themes are the default themes that comes with every Junker installation.
These base themes includes all the required template files required for the namespace.
Junker themes uses two locations:
- For all the theme’s templates/view files.
For example, a theme named “test” would reside in the directory
resource/themes/test/ and if the theme have assets, those assets would reside in
If you’re using a custom public path other than “public” (i.e.: “public_html”), you’ll need to manually move the theme’s assets directory to the correct location.
Junker use the name of the enclosing folder of the theme as the internal theme name.
The theme.php file¶
All themes, no matter the namespace it belongs, must have a theme.php file. This file is used as an “entry-point” to the application.
The following example shows the Junker theme.php file for the Junker Default theme:
<?php return [ 'name' => 'Junker Default', 'description' => 'Designed exclusively for Junker, created with <a href="http://getbootstrap.com/" target="_blank">Bootstrap 3</a>.', 'author' => 'Gerardo Báez', 'version' => 'v1.0.0', 'previewImage' => 'images/preview.png', 'namespace' => 'frontend', ];
Possible theme configurations and their definition¶
||Name of the theme, can be any string.||YES|
||A brief description of the theme, can include HTML (like links, etc).||YES|
||The author of the theme||NO|
||Version of the theme (e.g.: v1.0.0)||NO|
||Theme thumbnail (screenshot, etc) (Path relative to the theme’s directory.||NO, but recommended|
||Namespace which the theme belongs to (
||Theme to extends (must be installed, value is the internal name of the theme)||YES|
The template files are PHP source files used to generate pages requested by the visitors. Themes uses Laravel’s Blade Template Engine.
First, determine what namespace you want to modify.
Once you know what namespace you want to change, locate and duplicate the base theme for that particular section.
theme.php file of the cloned theme and update all the necessary information.
If you are extending another theme, add the following:
'extends' => 'enter-the-theme-internal-name-here'
To enable your new theme, in your administration panel, go to Settings > Appearance > Themes, and select the theme you just created.