Hallo zusammen,
ich möchte diese Symbole ändern:
Ich habe es so gemacht:
Und ich habe es in der Kopfzeile geschrieben:
Aber das Symbol hat sich nicht geändert.
Es funktioniert bei anderen Symbolen.
Bitte helft mir, dieses Problem zu lösen.
Don
11. August 2021 um 13:36
2
Hallo Mikhail,
Bitte probiere diesen hier aus
<script type="text/discourse-plugin" version="0.8">
api.replaceIcon('notification.granted_badge', 'oo-medal-badges');
</script>
Diese Ersetzungen findest du hier
import { h } from "virtual-dom";
import { isDevelopment } from "discourse-common/config/environment";
import escape from "discourse-common/lib/escape";
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
let _renderers = [];
let warnMissingIcons = true;
let _iconList;
const REPLACEMENTS = {
"d-tracking": "bell",
"d-muted": "discourse-bell-slash",
"d-regular": "far-bell",
"d-watching": "discourse-bell-exclamation",
"d-watching-first": "discourse-bell-one",
"d-drop-expanded": "caret-down",
"d-drop-collapsed": "caret-right",
"d-unliked": "far-heart",
"d-liked": "heart",
"notification.mentioned": "at",
Ja, es hat funktioniert. Vielen Dank!
Und wo kann ich sehen, wie sie aussehen?
Don:
const REPLACEMENTS = {
"d-tracking": "bell",
"d-muted": "discourse-bell-slash",
"d-regular": "far-bell",
"d-watching": "discourse-bell-exclamation",
"d-watching-first": "discourse-bell-one",
"d-drop-expanded": "caret-down",
"d-drop-collapsed": "caret-right",
"d-unliked": "far-heart",
"d-liked": "heart",
"notification.mentioned": "at",
Don
11. August 2021 um 14:35
5
Sie können es ganz einfach identifizieren, indem Sie die Entwicklertools verwenden.
Zum Beispiel: die Benachrichtigung mit dem Zertifikat -Symbol
Finden Sie den Symbolnamen mit den Entwicklertools
Suchen Sie dasselbe Symbol in der icon-library.js
"notification.liked": "heart",
"notification.liked_2": "heart",
"notification.liked_many": "heart",
"notification.liked_consolidated": "heart",
"notification.private_message": "far-envelope",
"notification.invited_to_private_message": "far-envelope",
"notification.invited_to_topic": "hand-point-right",
"notification.invitee_accepted": "user",
"notification.moved_post": "sign-out-alt",
"notification.linked": "link",
"notification.granted_badge": "certificate",
"notification.topic_reminder": "far-clock",
"notification.watching_first_post": "discourse-bell-one",
"notification.group_message_summary": "users",
"notification.post_approved": "check",
"notification.membership_request_accepted": "user-plus",
"notification.membership_request_consolidated": "users",
"notification.reaction": "bell",
"notification.votes_released": "plus",
};
Anschließend können Sie das Symbol durch ein beliebig anderes Symbol ersetzen, das Sie möchten.
Danke für deine Antwort.
Ich habe es herausgefunden. Ich dachte, es gäbe eine Art Liste mit Standard-Discourse-Icons.
Darf ich das für zukünftige Referenz hinzufügen. Ich habe die Anweisungen unter Replace Discourse's default SVG icons with custom icons in a theme - #19 befolgt, aber was mir anfangs nicht bewusst war, ist, dass dasselbe Symbol auf verschiedene Arten referenziert werden kann. In der App selbst, unter „/styleguide/atoms/icons“, gibt es eine Liste aller Symbole und wie sie referenziert werden. In meiner header.html-Datei habe ich jetzt 5 Referenzen auf das Briefumschlag-Symbol:
api.replaceIcon('envelope', 'fgx-air-mail');
api.replaceIcon('far-envelope', 'fgx-air-mail');
api.replaceIcon('notification.private_message', 'fgx-air-mail');
api.replaceIcon('notification.read_private_message', 'fgx-air-mail');
api.replaceIcon('notification.invited_to_private_message', 'fgx-air-mail');