Render Emojis in your template, so that a :smile:
becomes a real ð
Copy or clone the project to your SilverStripe instance folder or using composer:
composer require pstaender/silverstripe-emoji-parser dev-master
Wheny you're done flush SilverStripe cache with ?flush=1
.
In your templates you can now parse Emojis with:
<h1>$Title</h1>
$Content.Parse(Emoji)
Of course also in combination with other parsers:
<h1>$Title</h1>
$Content.Parse(BBCodeParser).Parse(Emoji)
All rendered icon-image-tags contain the class emoji
so that you can easily define a style, for instance:
img.emoji {
height: 1em;
margin: 0 1em 0 1em;
}
You can access all emojis including the url to graphics by requesting Emojis_Controller
:
http://yourserver/Emojis_Controller/
and use the responded JSON:
{
"100": "silverstripe-emoji-parser/graphics/emojis/100.png",
"-1": "silverstripe-emoji-parser/graphics/emojis/-1.png",
"+1": "silverstripe-emoji-parser/graphics/emojis/+1.png",
â¦
}
You can optionally configure these values in your config.yml
:
Emojis:
basePath: pathToGraphics
cssClass: classNameForCSS
Implement alternate unicode characters.
The images are taken from Emoji-Cheat-Sheet.com and are under different Licenses.
This module is under The MIT License (MIT).
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem