ocPortal Tutorial: Releasing a theme
Written by Chris Graham, ocProductsIf you've developed your own theme for ocPortal, and would like to share it with others, we strongly encourage you to do so via ocportal.com's theme gallery.
Table of contents
Why distribute a theme
- The way for users to get a very different look to their website is to either re-theme it themselves, download a theme from the ocPortal site (or another source), or to buy the services of a professional to do the themeing for them. By releasing a theme, you are helping other ocPortal users, and giving yourself and your site some publicity for it.
- It's a good way to earn respect in the community – and points.
How to make a theme pack
Making a theme pack using the 'addon' facility
To actually make a theme pack that is ready for release, you just need to export your theme as an addon (as in the screen-shot).
Releasing your theme packOnce this is done, all you need to do is to upload the addon to our site:
- Go to our website
- Go to the community section
- Go to the themes section
- Use the 'Add a new download' link
- Fill in the Name/Upload/Author/Description and click the "Add a new download" button
- You will be invited on what to do next; we like it if users submit images to go with their theme so that's a good next step
Your theme will at first be non-validated (i.e. not live for download), but we will go and validate the theme as soon as we can after we receive it. Please be patient.
Editing your theme packYou can edit your download via the edit link when viewing it.
How other users get your theme packTheme packs are just packaged as normal ocPortal addons, so are installed from the addons part of the Admin Zone (under the Setup section).
The user will need to import the addon into their own site, which they can do either by point and click (all ocPortal.com's addons are shown for easy import), or via uploading the .tar file after downloading it manually from ocportal.com.
Once a theme is installed, it is available from the 'Manage themes' section of ocPortal, and can be set as active.
Automatic upgrades with new versionsThemes are built for a specific version of ocPortal. Particularly, the CSS files used are based on those from the default theme.
Sometimes a new version of ocPortal will change the CSS files, perhaps for reasons of styling a new feature, fixing a styling bug, or improving browser compatibility.
In order to allow such CSS changes to (hopefully) come through to the new theme from the altered default theme, upon upgrade, we store the source CSS files of the default theme within your theme as *.editfrom files. These files tell the upgrader what the CSS files were built from so it can compare that against the latest default theme CSS files (i.e. see what has changed in the upgrade), and apply those differences to your CSS files (if there are any in the upgrade).
This upgrade process happens on individual site's that use your theme, and hence why the *.editfrom files are included with what you release.