Themes can be used to kick start your SilverStripe projects, can be stored outside of your application code and your application can provide multiple unique themes (i.e a mobile theme).
Head to the Themes area of the website to check out the range of themes the community has built. Each theme has a page with links you can use to preview and download it. The theme is provided as a .tar.gz file.
Unpack the contents of the zip file you download into the
themes directory in your SilverStripe installation. The
theme should be accessible at
If a theme has
composer support you can require it directly through
composer require "author/theme_name" "dev/master"
As you've added new files to your SilverStripe installation, make sure you clear the SilverStripe cache by appending
?flush=1 to your website URL (e.g http://yoursite.com/?flush=1).
After installing the files through either method, update the current theme in SilverStripe. This can be done by
either altering the
SSViewer.theme setting in a config.yml or by changing the current theme in
the Site Configuration panel (http://yoursite.com/admin/settings)
SSViewer: theme: theme_name
Developing your own theme
located within the
Your theme can also be organised into split folders for each module it caters for.
themes blackcandy css style.css images templates Page.ss Layout Page.ss Includes blackcandy_blog css blog.css images templates Layout BlogHolder.ss BlogEntry.ss Includes
Submitting your theme to SilverStripe
If you want to submit your theme to the SilverStripe directory then check
- You should ensure your templates are well structured, modular and commented so it's easy for other people to customise
- Templates should not contain text inside images and all images provided must be open source and not break any copyright or license laws. This includes any icons your template uses.
Your theme file must be in a .tar.gz format. A useful tool for this is - 7 Zip. Using 7Zip you must select the your_theme folder and Add to archive, select TAR and create. Then after you have the TAR file right click it -> Add to Archive (again) -> Then use the archive format GZIP.