# Come cambiare icona del moderatore

**URL:** <https://meta.discourse.org/t/how-to-change-moderator-icon/356417>\
**Category:** Development\
**Created:** [8 Marzo 2025, 7:13pm UTC](https://meta.discourse.org/t/how-to-change-moderator-icon/356417 "2025-03-08T19:13:32Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![KeepBotting](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/keepbotting/32/492515_2.png) [@KeepBotting](https://meta.discourse.org/u/KeepBotting)\
**Post date:** [8 Marzo 2025, 7:13pm UTC](https://meta.discourse.org/t/how-to-change-moderator-icon/356417/1 "2025-03-08T19:13:33Z")

</div>

Ciao, ho letto questo: [Replace Discourse's default SVG icons with custom icons in a theme](https://meta.discourse.org/t/replace-discourses-default-svg-icons-with-custom-icons-in-a-theme/115736)

Ho creato un spritesheet (penso di averlo fatto correttamente):

```xml
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
    <symbol id="mod-crown" width="13" height="11" viewBox="0 0 13 11">
        <metadata><?xpacket begin="﻿" id="W5M0MpCehiHzreSzNTczkc9d"?>
            <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c142 79.160924, 2017/07/13-01:06:39 ">
                <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                    <rdf:Description rdf:about=""/>
                </rdf:RDF>
            </x:xmpmeta>
            <?xpacket end="w"?>
        </metadata>
        <defs>
            <style>
                .cls-1 {
                fill: #04b214;
                }

                .cls-1, .cls-2, .cls-3, .cls-4 {
                fill-rule: evenodd;
                }

                .cls-3 {
                fill: #29ec3a;
                }

                .cls-4 {
                fill: #1f8111;
                }
            </style>
        </defs>
        <path class="cls-1" d="M11,5V3h1V5H11ZM10,7v3H9V7H7V8H6V7H4v3H3V7H2V5H5V3H6V1H7V3H8V5h3V7H10ZM8,10H7V8H8v2ZM5,10V8H6v2H5ZM1,3H2V5H1V3Z"/>
        <path class="cls-2" d="M8,10V8H7V7H9v3H8ZM6,10V8H7v2H6ZM5,10H4V7H6V8H5v2Z"/>
        <path class="cls-3" d="M11,3V1h1V3H11ZM10,5V3h1V5H10ZM4,5V3H5V5H4ZM5,1H6V3H5V1ZM2,7H3v3H2V7ZM1,5H2V7H1V5ZM0,1H1V5H0V1Z"/>
        <path class="cls-4" d="M12,5V0h1V5H12ZM11,7V5h1V7H11Zm0,4H2V10h8V7h1v4ZM8,3H9V5H8V3ZM7,1H8V3H7V1ZM6,0H7V1H6V0ZM2,3H3V5H2V3ZM1,1H2V3H1V1ZM0,0H1V1H0V0Z"/>
    </symbol>
</svg>

```

Ho aggiunto l’asset a `about.json`:

```json
    "assets": {
        "mod-crown": "assets/mod-crown.svg"
    }

```

E ho aggiunto questo a `header.html`:

```html
<script type="text/discourse-plugin" version="0.8">
    api.replaceIcon('d-icon-shield-halved', 'mod-crown');
</script>

```

Ma l’icona non viene cambiata, l’icona dello scudo rimane. Cosa sto sbagliando?

---

_[View the full topic](https://meta.discourse.org/t/how-to-change-moderator-icon/356417)._
