## Creating a Derived Theme In this tutorial, we will learn how to make a derived theme. This is a theme that takes most of the settings from its "parent" theme and lets you change a few things to your liking without creating an entire theme package. This is a good starting point if you just want to change a few things from an existing theme, for example to give your hub a bit of personalised appearance. We will use the standard 'redbasic' theme for our parent theme in this tutorial. You may have to make some adaptions if you want to use another theme as your base, but the process will be the same. ### Lesson 1 – Getting started To create a derived theme, first choose a name. For our example we'll call our theme 'mytheme'. Hopefully you'll be a bit more creative. But throughout this document, wherever you see 'mytheme', replace that with the name you chose. #### Directory Structure First you need to create a theme directory structure. We'll keep it simple. We need a php directory and a css directory. Here are the Unix/Linux commands to do this. Assume that 'mywebsite' is your top level $projectname folder. ``` $ cd mywebsite $ mkdir view/theme/mytheme $ mkdir view/theme/mytheme/css $ mkdir view/theme/mytheme/php ``` #### The Theme Info file Great. Now we need a couple of files. The first one is your theme info file, which describes the theme. It will be called `view/theme/mytheme/php/theme.php` (clever name huh?) Inside it, put the following information - edit as needed ```php * Extends: redbasic */ ``` The top comment in the file makes up the information that is used by $Projectname for the information about the theme. Each of the lines is a kayword followed by a colon and a value. Notice the last line in the comment: `Extends: redbasic`. This is what tells $Projectname that this is a derived theme, and that it should get any elements missing from this theme from the parent theme. In this case we will be extending the theme 'redbasic'. We don't need any further code in this file for now, so just leave it empty. #### The PCSS file and style.css Now create another file. We call this a PCSS file, but it's really a PHP file. The file is called `view/theme/mytheme/php/style.php`. In it, put the following: ```php Display Settings as their default theme. #### Theme configuration and schemas If you want to keep the various configuration options for the derived theme, you have to add a configuration class for your child theme. Add another file, this time in `view/theme/mytheme/php/config.php`. Add the following content to it: ```php