From 66dc228be81d0ca78e1689f675a8040ee92f0016 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 8 Mar 2014 21:13:42 -0800 Subject: HOWTO create a derived theme lesson 1. Do not attempt to do anything more complicated until you have successfully completed this exercise. --- doc/DerivedTheme1.md | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 doc/DerivedTheme1.md (limited to 'doc/DerivedTheme1.md') diff --git a/doc/DerivedTheme1.md b/doc/DerivedTheme1.md new file mode 100644 index 000000000..d20a958f2 --- /dev/null +++ b/doc/DerivedTheme1.md @@ -0,0 +1,78 @@ +Creating a Derived Theme +======================== + +**Lesson 1** + +A derived theme 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. + + +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 Red Matrix folder. + + + cd mywebsite + mkdir view/theme/mytheme + mkdir view/theme/mytheme/css + mkdir view/theme/mytheme/php + + +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 + + theme_info['extends'] = 'redbasic'; + + + } + + +Remember to rename the mytheme_init function with your theme name. In this case we will be extending the theme 'redbasic'. + + +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: + + Display Settings as their default theme. + + + \ No newline at end of file -- cgit v1.2.3