Markus Michalski FAQ

Sylius Media Alt Text: Installation

Installing the Sylius Media Alt Text plugin via Composer (Packeton): register the bundle, import the admin route, create the tables with the setup command, plus update and uninstallation.

Deutsche Version

Back to overview

Sylius Media Alt Text: Installation

This documentation always describes the latest published version.

Installation

Composer (Packeton)

Private repositories are managed through Packeton (https://packeton.markus-michalski.net). You receive credentials after purchasing a license or once access has been granted.

Add Packeton as a repository in composer.json:

{ "repositories": [{ "type": "composer", "url": "https://packeton.markus-michalski.net" }] }
composer require mmd/sylius-media-alt-text-plugin

Then, in this order:

  1. Register the bundle in config/bundles.php:

    Mmd\SyliusMediaAltTextPlugin\MmdSyliusMediaAltTextPlugin::class => ['all' => true],
    
  2. Import the admin route in config/routes/mmd_sylius_media_alt_text.yaml:

    mmd_sylius_media_alt_text_admin:
        resource: "@MmdSyliusMediaAltTextPlugin/config/routes/admin.yaml"
    
  3. Create the tables:

    bin/console mmd:media-alt-text:setup
    

The plugin ships no assets of its own, so assets:install is not needed. The bundle registers the Doctrine mapping, migrations, API Platform mapping, Twig hooks, template overrides and the form theme itself.

The setup command

mmd:media-alt-text:setup replaces doctrine:migrations:migrate. It has no options and does the following:

Without the route import from step 2, the menu entry is missing in the admin. The sidebar does not break; the entry is simply left out.

Update

composer update mmd/sylius-media-alt-text-plugin
bin/console mmd:media-alt-text:setup
bin/console cache:clear

Uninstallation

The order matters: the migrations must be rolled back while the bundle is still registered:

  1. Remove your own templates that call mmd_image_alt (otherwise rendering fails without the plugin, see Storefront)

  2. Roll back the migrations, newest first:

    bin/console doctrine:migrations:execute --down 'Mmd\SyliusMediaAltTextPlugin\Migrations\Version20261025110000'
    bin/console doctrine:migrations:execute --down 'Mmd\SyliusMediaAltTextPlugin\Migrations\Version20261025100000'
    
  3. Remove the route import and the bundle entry

  4. composer remove mmd/sylius-media-alt-text-plugin

Rolling back deletes all maintained alt texts and the setting. Back up the tables first if you want to keep the texts.