This plugin is an example of a child theme for the Workplace theme (theme_workplace) used in
Moodle Workplace product. It is intended to be used as a starting point for creating your own
theme based on Workplace theme.
This plugin is open-source but it can only be used with Workplace product and it requires Workplace theme to be installed. Supported versions:
- Moodle Workplace 4.1 with the build date no earlier than 2023-07-17 (4.1.4+ or 4.1.4+ Rolling).
- Any version of Moodle Workplace 4.2.
Features introduced in this plugin are added to demonstrate the possibilities only, they may not have any practical use.
- Functions
theme_wpchild_extend_tenant_edit_css_form(),theme_wpchild_tenant_get_css_config()theme_wpchild_process_tenant_edit_css_requests()inlib.phpimplement respective callbacks fromtool_tenantand allow to extend the tenant Branding form and adds a file manager element for the Background image. - Class
\tool_wpchild\managercontains functions that actually add this background image to the tenant CSS. These functions are called from the standard callbacks for theme pluginstheme_wpchild_get_main_scss_content()andtheme_wpchild_alter_css_urls(). - Folder
scss/contains scss files that add the background image and change the fonts. - File
settings.phpdefines the settingstheme_wpchild/scsspreandtheme_wpchild/scsssimilar to how Workplace theme defines them.
- Copy the folder
/theme/wpchild/to a new folder/theme/newtheme/wherenewthemeis your theme name. - Inside the new folder rename the file
lang/en/theme_wpchild.phptolang/en/theme_newtheme.php. - Search
wpchildin the all folder files and replace withnewtheme. - Now you can install this theme and start modifying settings, callbacks and scss files to implement your theme features.
- Substitute
pix/screenshot.jpgwith your own image. - Remove or replace files
README.mdandCHANGELOG.mdsince they describe the features and changes in thetheme_wpchildplugin. - Remove file
.gitlab-ci.ymlunless you also use GitLab CI for continuous integration and testing.