firesphere / wysiwyg-font-awesome
Add Font Awesome icons to the content with shortcodes
Installs: 1 967
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 0
Type:silverstripe-module
Requires
- silverstripe/cms: ^3.2
- silverstripe/framework: ^3.2
This package is auto-updated.
Last update: 2024-12-16 19:27:48 UTC
README
Installation
composer require firesphere/wysiwyg-font-awesome
Usage
Add the FontAwesome CSS to your frontend. Otherwise, fonts won't be loaded.
In your WYSIWYG, add [fa icon="icon-name" {optional: spin="" rotate="90" size="1|2|3|4" flip="horizontal|vertical"}]
Note, the values between the curly braces are not required, they are however in the case of spin
, required to have an empty argument.
One of the shortcomings of the current ShortcodeParser in Framework.
In your content, each [fa icon="my-icon"]
will be rendered as <i class="fa fa-my-icon optional-items"></i>
Add custom modifiers
In your config.yml:
FontAwesomeParser: modifiers: mymodifier: code: 'modifyme' arguments: true|false
If the modifier takes arguments, set it to true, otherwise, it's false (still needs an empty argument though).
Actual license
This module is published under BSD 3-clause license, although these are not in the actual classes, the license does apply:
http://www.opensource.org/licenses/BSD-2-Clause
Copyright (c) 2017-NOW(), Simon "Sphere" Erkelens
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(I shouldn't scream, should I? This is copy-paste from BSD-2 license...)
Cow?
Of course!
/( ,,,,, )\
_\,;;;;;;;,/_
.-"; ;;;;;;;;; ;"-.
'.__/`_ / \ _`\__.'
| (')| |(') |
| .--' '--. |
|/ o o \|
| |
/ \ _..=.._ / \
/:. '._____.' \
;::' / \ .;
| _|_ _|_ ::|
.-| '==o==' '|-.
/ | . / \ | \
| | ::| | | .|
| ( ') (. )::|
|: | |; U U ;|:: | `|
|' | | \ U U / |' | |
##V| |_/`"""`\_| |V##
##V## ##V##