In a Support discussion titled How to include fontawesome icons in posts?, users explore methods to embed Font Awesome icons inline for instructional purposes, particularly to guide new members through Discourse UI elements like notifications, search, and menu icons. tobiaseigen initiates the thread seeking a workaround or plugin, noting the desire to use icons like fa-comments, fa-search, and fa-sandwich. codinghorror advises against arbitrary CSS in posts and recommends standard emoji for broader compatibility. Mittineague proposes a JavaScript workaround to whitelist Font Awesome classes, while sam acknowledges a valid edge case for teaching UI glyphs — though suggests screenshots as an alternative. simon discovers that uploading SVG versions of Font Awesome icons works in some environments, but notes display inconsistencies across instances, likely due to SVG upload restrictions for security. tobiaseigen confirms success locally but encounters display issues on their live site. pacharanero provides a detailed workaround: enabling SVG uploads in site settings, then dragging and dropping icons into the custom emoji manager to use them via :iconname: syntax. Alex_Reguyal reports an error (“couldn’t determine image size”) when uploading SVGs, which zogstrip investigates and confirms as fixed in newer versions. tobiaseigen ultimately settles on using screenshots for clarity. The thread concludes with zogstrip affirming the fix and inviting users to reopen if issues persist in the latest Discourse version.
I’ve seen this in the past and would love to be able to include fontawesome icons on a regular basis. Can’t find it! For right now if someone could help me with a hack I’d be grateful. I want to embed the fa-comments, fa-search and fa-sandwich (or whatever it’s called) in a post explaining discourse features.
Down the road.. perhaps there’d even be appetite for a plugin to support fa tags as emoji? Came across this interesting page:
That is a nice workaround but IMO you are better off teaching users standard emoji, which is a Unicode standard and will basically work anywhere in the future – versus the random, arbitrary font awesome classes.
There is one edge case where this is reasonable, teaching people what the various glyphs in Discourse mean. Though, probably, screenshots would do fine for that case.
This is precisely what I am trying to do. I’ve written up a new member checklist and want to reference the notifications, search, hamburger menu options, inline, like this. ☰ But I don’t know how to do that for notification and search.
It seems that font-awesome icons will work if you upload them as svg files. I am surprised that they are displaying inline correctly. I don’t know if you can count on them doing that.
Many thanks! This is the solution I am looking for, simply to help show new members around my site. It’s easier to say “look for the to see your notifications” than the alternatives. w00t!
However, on my site for some reason the svgs are not displaying correctly, even though I allow uploading of all file types. Is there another setting I am missing?
I just tried it on a live instance of Discourse and I am getting the same results as you are. It works in my local development environment, and it works here on meta.discourse. If I include the link to one of the SVG images from this topic on my own forum then it displays correctly. I am guessing that SVG file uploads are being disallowed for security reasons.
Drag and drop a multiple selection from your file manager into the input box at http://{yoursite}/admin/customize/emojis and you will see them added to the Custom Emoji list, with a default name that is the same as the filename.
Refresh the page, and you can now search your custom emoji when typing by starting with : and typing a few characters of the emoji you want.
I followed all the instructions above but in the third step, I get this message that had been raised multiple times in this forum: Sorry, but we couldn’t determine the size of the image. Maybe your image is corrupted?