Markus Michalski FAQ

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.

Deutsche Version

Back to overview

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.

  1. Download the latest release from GitHub Releases.
  2. Extract the ZIP file.
  3. 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

  1. Log in to the osTicket Admin Panel.
  2. Open Manage → Plugins and choose Add New Plugin.
  3. Select Custom CSS Loader and install it.
  4. Enable the plugin.

On activation enable() runs and does the following in order:

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.