Skip to content

Installation

Requirements

  • Drupal core ^11.1 or ^12.
  • The core Taxonomy module, which Tagify declares as a dependency.
  • Optional: Token for the token browser in the info label settings.

Submodules have their own requirements; see each submodule page.

Install the module

composer require drupal/tagify
drush en tagify

Or enable Tagify at /admin/modules.

The Tagify JavaScript library

By default the module loads Tagify 4.37.1 from cdnjs.cloudflare.com. That works without any extra step, but fails where third party requests are blocked: a strict Content Security Policy, an offline deployment, or a company policy. The Tagify formatter also loads the Tagify stylesheet on front end pages, so with the CDN every visitor requests it from a third party. Serve the library locally if that matters for your privacy or consent policy.

The module checks for dist/tagify.js in these directories, in this order:

  1. libraries/tagify, used by options 1 and 2 below.
  2. libraries/yaireo--tagify, where Asset Packagist installs the library (option 3).

When the file exists, the local copy replaces the CDN files automatically. If both directories exist, libraries/tagify is used.

Tagify 4.38.0 and later no longer ship dist/tagify.polyfills.min.js, which only Internet Explorer needs. With such a local copy, the module loads no polyfills instead of fetching them from the CDN.

Option 1: download the library

  1. Download the release from https://github.com/yairEO/tagify/releases/tag/v4.37.1.
  2. Extract it to libraries/tagify, so that libraries/tagify/dist/tagify.js exists.

Option 2: Composer

Add a package repository to the project's composer.json:

"repositories": [
    {
        "type": "package",
        "package": {
            "name": "yaireo/tagify",
            "version": "4.37.1",
            "type": "drupal-library",
            "dist": {
                "url": "https://github.com/yaireo/tagify/archive/refs/tags/v4.37.1.zip",
                "type": "zip"
            }
        }
    }
]

Make sure drupal-library packages install into web/libraries:

"extra": {
    "installer-paths": {
        "web/libraries/{$name}": ["type:drupal-library"]
    }
}

Then require it:

composer require yaireo/tagify

Option 3: Asset Packagist

If the project already uses Asset Packagist for front end libraries, add it as a repository:

"repositories": [
    {
        "type": "composer",
        "url": "https://asset-packagist.org"
    }
]

npm-asset packages need the oomphinc/composer-installers-extender Composer plugin to install into web/libraries. Allow the plugin, then require it:

composer config allow-plugins.oomphinc/composer-installers-extender true
composer require oomphinc/composer-installers-extender

Then add the npm-asset type to installer-types and to the web/libraries/{$name} entry of installer-paths:

"extra": {
    "installer-types": ["npm-asset"],
    "installer-paths": {
        "web/libraries/{$name}": ["type:drupal-library", "type:npm-asset"]
    }
}

Then require it:

composer require "npm-asset/yaireo--tagify:^4.37"

The package installs into web/libraries/yaireo--tagify, so that libraries/yaireo--tagify/dist/tagify.js exists.

Check which source is active

Open the status report at /admin/reports/status and find Tagify library. It reads Served locally or Loaded from CDN. The browser's Network tab shows the same thing.