The Classifier Plugin is for Grav CMS. It allows you to add class declarations to specific HTML tags in a final rendered page.
Installing the Classifier plugin can be done in one of two ways. The GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file.
GPM Installation (Preferred)
The simplest way to install this plugin is via the Grav Package Manager (GPM) through your system's terminal (also called the command line). From the root of your Grav install type:
bin/gpm install classifier
This will install the Classifier plugin into your
/user/plugins directory within Grav. Its files can be found under
To install this plugin, just download the zip version of this repository and unzip it under
/your/site/grav/user/plugins. Then, rename the folder to
classifier. You can find these files on GitHub or via GetGrav.org.
You should now have all the plugin files under
Before configuring this plugin, you should copy the
user/config/plugins/classifier.yaml and only edit that copy.
Here is the default configuration and an explanation of available options:
enabled: true active: false
enabledfield lets you turn the plugin on or off.
activefield is usually left as
falseand only enabled in the frontmatter of the page you wish to affect.
To activate the plugin, insert something like the following into the page's frontmatter:
classifier: active: true tags: - tag: table nums: \* class: tinytext
activefield is what tells the plugin that you actually want to process the output of this page. Otherwise the plugin doesn't execute.
tagsfield is where you specify what and which tags you wish to alter.
tagis the name of the HTML tag you want to find. It should be lowercase. In this example, you are looking for
numstells the plugin which specific
<table>tags you're looking for. Usually you would give a comma-delimited list of numbers (e.g., 1,2,4). In the example, we use
\*to mean all
classis a string that will be inserted into the
classattribute of the matching tags. It is inserted verbatim. The plugin does no checking that classes are not duplicated, misspelled, or malformed. It simply inserts the string.
You can also insert a
classifier tag in your global
frontmatter.yaml or put
tags into the global config (
If the class already exists in the loaded CSS, then great, but the plugin will also check for a dedicated CSS file and load it if found: