# Можно ли изменить иконку для уведомлений персонала?

**URL:** https://meta.discourse.org/t/is-it-possible-to-change-the-icon-for-staff-notices/271436
**Category:** Development
**Tags:** post-notices
**Created:** [26.Июнь.2021 17:23:13 UTC](https://meta.discourse.org/t/is-it-possible-to-change-the-icon-for-staff-notices/271436 "2021-06-26T17:23:13Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![dan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan/32/101549_2.png) [@dan](https://meta.discourse.org/u/dan)
#### Post date: [29.Июнь.2021 07:36:31 UTC](https://meta.discourse.org/t/is-it-possible-to-change-the-icon-for-staff-notices/271436/2 "2021-06-29T07:36:31Z")

</div>

У нас нет настройки для этого, и я думаю, что сделать это только с помощью CSS сложно, но вы можете создать компонент темы, чтобы заменить его.

В CSS вы скроете старую иконку:

```css
.post-notice {
  .d-icon-user-shield {
    display: none;
  }
}

```

В JavaScript (поместите это в `<head>` компонента темы) вы украсите уведомление и добавите новую иконку:

```javascript
<script type="text/discourse-plugin" version="0.8">
  const { iconNode } = require("discourse-common/lib/icon-library");
  api.decorateWidget('post-notice:before', helper => {
    return iconNode('heart');
  });
</script>

```

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/a/4a8bd2d4508a09b17d0c49694e9b4e3608640d41.png)

… или, если вы хотите заменить её изображением…:

```javascript
<script type="text/discourse-plugin" version="0.8">
  api.decorateWidget('post-notice:before', helper => {
    return helper.h('img', {
      src: 'https://www.discourse.org/a/img/home-spot-1.png',
      style: 'margin-right: 0.65em',
      height: 30,
      width: 30
    });
  });
</script>

```

 ![Screenshot 2021-06-29 at 10.35.10](https://global.discourse-cdn.com/meta/original/3X/9/5/959c45bf56f8b1f34de121afaf5a2282ef06ffcf.png)

С темами и компонентами тем возможности безграничны. Если вы хотите узнать больше, у нас есть ресурс для этого:

> [@Developing Discourse Themes & Theme Components](https://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648):
>
> Discourse Themes and Theme Components can be used to customize the look, feel and functionality of Discourse’s frontend. This section of the developer guides aims to provide all the reference materials you need to develop simple themes for a single site, right up to complex open-source theme components. This introduction aims to provide a map of all the tools and APIs for theme development. If you prefer a step-by-step tutorial for theme development, jump straight to: Themes vs. Theme Compon…

---

_[View the full topic](https://meta.discourse.org/t/is-it-possible-to-change-the-icon-for-staff-notices/271436)._
