Custom CSS Loader: Installation
Install Custom CSS Loader: release ZIP or Git clone with Composer autoloader, activation in the Admin Panel, CSS folder and demo files, update and deactivation.
Custom CSS Loader: Installation
Provide the plugin files
The plugin belongs in its own folder under include/plugins/, the recommended name is custom-css-loader.
/path/to/osticket/include/plugins/custom-css-loader/
When it is included, the plugin class loads vendor/autoload.php. This Composer autoloader must exist in the plugin folder, otherwise loading the plugin aborts with a fatal error.
ZIP download (recommended)
- Download the latest release from GitHub Releases.
- Extract the ZIP file.
- Upload the folder to
include/plugins/custom-css-loader/.
The release ZIP contains the autoloader (vendor/autoload.php and vendor/composer/), no further steps are needed.
Git clone
The vendor/ directory is not part of the repository. After cloning, generate the autoloader with Composer.
cd /path/to/osticket/include/plugins
git clone https://github.com/markus-michalski/osticket-custom-css-loader.git custom-css-loader
cd custom-css-loader
composer install --no-dev
The plugin has no runtime dependencies other than PHP 8.1. Composer is only needed for the autoloader of the plugin's own classes in
src/.
Enable the plugin
- Log in to the osTicket Admin Panel.
- Open Manage → Plugins and choose Add New Plugin.
- Select Custom CSS Loader and install it.
- Enable the plugin.
On activation enable() runs and does the following in order:
- Singleton instance: If no instance exists yet, an active one is created automatically.
- CSS folder: If
assets/custom/css/is missing in the osTicket root directory, it is created with mode0755. - Demo files: If the folder contains no
.cssfile yet,custom-staff.cssandcustom-client.cssare copied in fromassets/demo/. Existing files are never overwritten. - Version: The plugin version is stored as
installed_version.
If the web server cannot create the folder, the plugin writes a message to the PHP error log. Then create the folder yourself:
mkdir -p /path/to/osticket/assets/custom/css
chmod 755 /path/to/osticket/assets/custom/css
The folder must be reachable through the web server, because the browser loads the CSS files from <osTicket path>/assets/custom/css/<file>.
Update
On every start the plugin compares installed_version with the version in plugin.php. If the value is missing or lower, the plugin makes sure the CSS folder exists and stores the new version. Your CSS files are not touched. With the ZIP, the vendor/ folder inside the plugin folder is replaced along with the rest. With a Git clone, run composer install --no-dev again after pulling.
Deactivate
Deactivating in the Admin Panel stops the inclusion. The CSS files and the assets/custom/css/ folder remain, the plugin deletes nothing.