nthmedia/cp-site-icons

Display site icon when editing entries

Installs: 3 335

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:craft-plugin

pkg:composer/nthmedia/cp-site-icons

3.1.0 2026-02-18 16:46 UTC

This package is auto-updated.

Last update: 2026-02-18 16:47:35 UTC


README

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

Screenshot

Requirements

This plugin requires Craft CMS 5.

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.

  5. Create /config/cp-site-icons.php and add your configuration.

Configuration

Basic example with emoji flags

<?php

return [
    'icons' => [
        'de' => '🇩🇪',
        'de-AT' => '🇦🇹',
        'en' => '🇬🇧',
        'es' => '🇪🇸',
        'fr' => '🇫🇷',
        'it' => '🇮🇹',
        'nl' => '🇳🇱',
        'nl-BE' => '🇧🇪',
    ],
];

Custom CSS properties

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

<?php

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

Position

By default, icons are shown on the page title when editing entries. Since version 3.1.0, you can also replace the globe icon in the breadcrumb bar with a site icon.

Use the position option to control where icons appear:

<?php

return [
    // Show icon in the breadcrumb only
    'position' => ['breadcrumbIcon'],

    // Show icon on the page title only (default)
    'position' => ['pageTitle'],

    // Show icon in both locations
    'position' => ['breadcrumbIcon', 'pageTitle'],

    'icons' => [
        'en' => '🇬🇧',
        'nl' => '🇳🇱',
    ],
];

When position is omitted, it defaults to ['pageTitle'] for backwards compatibility.

Credits