nthmedia / cp-site-icons
Display site icon when editing entries
Installs: 3 305
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:craft-plugin
Requires
- php: ^8.0
- craftcms/cms: ^5.0.0
Requires (Dev)
- craftcms/ecs: dev-main
- craftcms/rector: dev-main
- phpstan/phpstan: ^1.6
README
Display site icon when editing entries, to be able to distinguish between different sites.
Requirements
This plugin requires Craft CMS 3 or 4
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require nthmedia/cp-site-icons
-
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
-
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
- Brought to you by NTH media
- Based on a code snippet of Dennis Frank, shared at DotAll 2021.