/cp-site-icons

CP Site Icons plugin for Craft CMS 3 & 4

Primary LanguagePHPMIT LicenseMIT

CP Site Icons plugin for Craft CMS

Display site icon when editing entries, to be able to distinguish between different sites.

Screenshot

Requirements

This plugin requires Craft CMS 3 or 4

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require nthmedia/cp-site-icons
    
  3. In the Control Panel, go to Settings โ†’ Plugins and click the โ€œInstallโ€ button for CP Site Icons. Or enable it through the command line:

     ./craft plugin/install cp-site-icons
    
  4. You can choose if you want the site handle or site language as key to distinguish your sites. This key is also the key of the icons array in the config:

5a. Create /config/cp-site-icons.php and add your configuration, for example:

<?php

return [
   'icons' => [
      'de' => '๐Ÿ‡ฉ๐Ÿ‡ช',
      'de-AT' => '๐Ÿ‡ฆ๐Ÿ‡น',
      'en' => '๐Ÿ‡ฌ๐Ÿ‡ง',
      'es' => '๐Ÿ‡ช๐Ÿ‡ธ',
      'fr' => '๐Ÿ‡ซ๐Ÿ‡ท',
      'it' => '๐Ÿ‡ฎ๐Ÿ‡น',
      'nl' => '๐Ÿ‡ณ๐Ÿ‡ฑ',
      'nl-BE' => '๐Ÿ‡ง๐Ÿ‡ช',
   ],
];

5b. You can also use handles and/or custom CSS properties:

<?php

return [
   'icons' => [
      'siteA' => [
         'background' => 'url(/favicon/favicon-32x32.png)',
         'background-size' => 'cover',
         'content' =>  '""',
      ],
];

Credits