-
Notifications
You must be signed in to change notification settings - Fork 14
Theme manager
Home > Theme manager
Theme manager allows to use a set of custom static content files (images, css, javascript files...) and/or templates (HTMLs) creating a custom theme or look for OCF without overwriting or substituting any file of OCF and taking advantatge of what is already there. These custom files must be named equal than the OCF main files that are replacing.
Ofelia Control Framework's static content is distributed in the three main modules (vt_manager, expedient, optin_manager). Every module has its static content distributed in static paths like this one:
OCF_MEDIA_PATH/static/path/to_media/media/
In media directory there is the folder default. Here there are all the images and css and javascripts main files of OCF. Usually the static content is organized in subdirectories sepparating the different static content files type.
The Django templates have a similar static content distribution, also separated in the three main modules and using a path like this:
OCF_TEMPLATE_PATH/templates/
In templates directory there is the folder default. Here there are all the templates, some distributed in different subdirectories and the others in default directory.
Theme Manager takes advantage of static content and template dirs disposition, organizing the files in media path or template path in a new folder named THEME with the same structure than default. The structure of THEME must be equal than default only for the customed files.
The theme myTheme is running and the only diference with OCF is the main logo in vtmanager. The first thing is check that the setting variable THEME is equal to myTheme and then check the media paths.
The main logo of vt_manager in OCF is in OCF_MEDIA_PATH/static/path/to_media/media/default/img/vm_logo.png
.
So to use the custom logo, the new logo (called vm_logo.png too) must be in OCF_MEDIA_PATH/static/path/to_media/media/myTheme/img/vm_logo.png
When a file (static Content file or template) is loaded, Theme Manager looks for the file in the custom theme dirs, if the file is found, Theme Manager will serve this custom content; if not, Theme manager will serve this file from OCF default dirs.
- Set the variable THEME equal to the name of your theme in localsettings/mySettings.py.
- Create a directory named as your theme in media path and create the subdirectories you need in order to mantain the structure of OCF.
- Create the directory or directories named as your theme in tempalate paths and create the subdirectories you need in order to maintain the structure of OCF.
- Add your custom files to your theme directory respecting the structure and the name as in OCF.
In this example a theme called myTheme will be created in Expedient.
- First of all, edit localsettings.py in OFELIA_DIR/expedient/src/python/expedient/clearinghouse/ and set the var THEME = 'myTheme'.
- Open the media dir in OFELIA_DIR/expedient/src/static/expedient/clearinghouse/media/ and create the folder myTheme.
- Create the directories css/, img/ and js/ * in OFELIA_DIR/expedient/src/static/expedient/clearinghouse/media/myTheme/.
- Open the template dir OFELIA_DIR/expedient/src/templates/ and create the directory myTheme/.
- Create the necessary directories in OFELIA_DIR/expedient/src/templates/myTheme/ to obtain the same structure as in OFELIA_DIR/expedient/src/templates/default/ *.
- Open the template directory OFELIA_DIR/expedient/src/python/vt_plugin/views/templates/ and create the directory myTheme/.
- Place the content of myTheme (images, js, css, HTMLs...) in the correct folder and restart apache server.
In this example a theme called myTheme will be created in Opt-in manager.
- Edit localsettings.py in OFELIA_DIR/optin_manager/src/python/openflow/optin_manager/ and set the var THEME = 'myTheme'
- Open the the media dir in OFELIA_DIR/optin_manager/src/static/openflow/optin_manager/media/ and create the directory myTheme/.
- Create the directory js/ * in OFELIA_DIR/optin_manager/src/static/openflow/optin_manager/media/myTheme/
- Open the template dir in OFELIA_DIR/optin_manager/src/templates/default/openflow/optin_manager/ and create the directory myTheme
- Create the necessary directories in OFELIA_DIR/optin_manager/src/templates/default/openflow/optin_manager/myTheme to obtain the same structure as in OFELIA_DIR/optin_manager/src/templates/default/openflow/optin_manager/deafult *.
- Place the content of myTheme (images, js, css, HTMLs...) in the correct folder and restart apache server.
In this example a theme called myTheme will be created in VT manager.
- Edit the mySettings.py in OFELIA_DIR/vt_manager/src/python/vt_manager/mySettings.py and set the var THEME = 'myTheme'
- Open the media dir in OFELIA_DIR/vt_manager/src/python/vt_manager/views/static/media/ and create here the directory myTheme/.
- In OFELIA_DIR/vt_manager/src/python/vt_manager/views/static/media/myTheme create the directories css/, images/, js/ and fancybox/ *.
- Open the templates dir in OFELIA_DIR/vt_manager/src/python/vt_manager/views/templates/ and create the folder myTheme/
- Open the directory vt_manager/src/python/vt_manager/views/templates/myTheme and create the directories networking/, policyEngine/, registration/, servers/ and users/ *.
- Place the content of myTheme (images, js,css, HTMLs...) in the correct folder and restart apache server.
Note: Please note that you only need to create the directories, or paths, of files you want to replace from the custom theme. I.e. if you only need to replace the logo of the OCF in Expedient, then you would only need to create the img dir path and place there the new logo with the name logo-expedient.png.
- Overview
- Experimenting
-
Administering
- Installing
- Upgrading
-
Configuration
- Components
- Infrastructure
- Troubleshooting
- Theme manager
-
Contributing
- Developing
-
Reporting
- Issue tracker and Roadmap