Nisutec
(Niclas)
5 Dicembre 2019, 5:43am
1
Ciao,
È possibile cambiare l’icona dello staff da Admin e Mod a un’altra icona?
Dai un’occhiata a questo argomento:
Custom descriptions for automatic groups (admin/moderator/trust levels) will be available soon along with a new groups directory design.
I don’t think there’s a reason to not have flair for those groups, there’s just a bit of a complication where flair is currently used to show a user’s primary group, and automatic groups can’t be set as primary groups… so it’s a little more complicated than it seems on the surface.
There’s some related discussion about this here: Avatar Flair Image for Staff…
Nisutec
(Niclas)
5 Dicembre 2019, 6:51am
3
Grazie per queste informazioni, ma cambierò l’icona dello scudo dietro il nome utente di un membro dello staff.
Se questo è ciò che vuoi modificare, l’icona accanto al nome utente
Aggiungi questo all’intestazione comune:
<script type="text/discourse-plugin" version="0.8">
api.replaceIcon('shield-alt', 'terminal');
</script>
“terminal” è quello che ho scelto; sostituiscilo con la tua preferenza.
Inoltre, aggiungi ciò che hai scelto alla “sottoinsieme di icone SVG” nel tuo pannello di amministrazione.
Se ti perdi, probabilmente basta cercare “sottoinsieme di icone SVG” qui.
Nisutec
(Niclas)
6 Dicembre 2019, 6:12am
5
Ho aggiunto il seguente codice all’intestazione
Ma ora l’icona dello scudo è nascosta. Come posso usare un’altra icona FA?
È possibile aggiungere icone FA Pro al “sottoinsieme di icone SVG”.
Non lo so, sicuramente dovresti abbonarti/pagare e probabilmente dovresti modificare lo script per adattarlo a questo.
Forse contattali e chiedi, per favore riferisci i risultati. Non sono sicuro che valga la pena spendere 99 $ all’anno, ma se abbastanza persone lo chiedono, forse Discourse può ottenere/aggiungere una licenza?
Fino ad allora puoi usare quelle gratuite.
Canapin
(Coin-coin le Canapin)
6 Dicembre 2019, 2:54pm
7
Non sono sicuro che possa essere utile, ma forse puoi dare un’occhiata a questo:
You can replace a Discourse’s default SVG icons individually or as a whole with your own custom SVG and override them within a theme or theme component.
Step 1 - Create an SVG Spritesheet
To get started, you must create an SVG Spritesheet. This can contain anything from a single additional custom SVG icon up to an entire replacement set of hundreds.
The spritesheet should be saved as an SVG file. In principle, you are nesting the <svg> tag contents from the original SVG icon file into <symbol> …
See also: We're upgrading our icons to Font Awesome 6!
We will shortly merge into master a branch that upgrades Discourse to Font Awesome 5.5.0 (the free version) and switches to using SVG icons instead of an icon font. This is a substantial change, with lots of benefits, and one significant change for developers.
Here is a quick rundown of the changes:
using SVG icons will provide crisper icons, better for accessibility and easier to customize, see this Github article for more details
since…
Nisutec
(Niclas)
6 Dicembre 2019, 6:43pm
8
Ok, la prima riga del mio header serve per la possibilità di utilizzare tutte le icone FA. Ma al momento l’API probabilmente non può accedervi.
Proverò a fare una richiesta di funzionalità per questo.
Grazie a tutti per l’aiuto
Nisutec
(Niclas)
6 Dicembre 2019, 9:29pm
9
Come posso utilizzare un file SVG personalizzato come icona?
Ho caricato il file SVG su Dark Design.
E ho il seguente header personalizzato
<script type="text/discourse-plugin" version="0.8">
api.replaceIcon('shield-alt', '$shield-alt-duotone');
</script>
Ma l’icona non è visibile.
Canapin
(Coin-coin le Canapin)
6 Dicembre 2019, 9:45pm
10
Non è così che funziona. $shield-alt-duotone è una variabile destinata all’uso nel tuo CSS personalizzato. Il primo argomento a cui ho collegato in precedenza spiega come sostituire le icone con nuove tramite un file SVG:
You can replace a Discourse’s default SVG icons individually or as a whole with your own custom SVG and override them within a theme or theme component.
Step 1 - Create an SVG Spritesheet
To get started, you must create an SVG Spritesheet. This can contain anything from a single additional custom SVG icon up to an entire replacement set of hundreds.
The spritesheet should be saved as an SVG file. In principle, you are nesting the <svg> tag contents from the original SVG icon file into <symbol> …