Download the PHP package contao-themes-net/font-awesome-inserttag-bundle without Composer
On this page you can find all versions of the php package contao-themes-net/font-awesome-inserttag-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download contao-themes-net/font-awesome-inserttag-bundle
More information about contao-themes-net/font-awesome-inserttag-bundle
Files in contao-themes-net/font-awesome-inserttag-bundle
Package font-awesome-inserttag-bundle
Short Description Font Awesome Inserttag Bundle for Contao 4 and 5
License LGPL-3.0-or-later
Informations about the package font-awesome-inserttag-bundle
Font Awesome Inserttag Bundle
Dieses Bundle installiert einen InsertTag, mit dessen Hilfe Font Awesome Icons als Font oder via SVG in Contao genutzt werden können.
About Font Awesome
The full suite of pictographic icons, examples, and documentation can be found at: https://fontawesome.com/
License
- The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL
- Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - http://opensource.org/licenses/mit-license.html
- The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/
- Attribution is no longer required in Font Awesome 3.0, but much appreciated: "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"
Allgemeine Form des Tags
Das Tag beginnt mit dem Prefix und ihm folgen drei weitere Parameter. Parameter 1 und 2 sind erforderlich, Parameter 3 und 4 sind optional und können auch weggelassen werden. Das Tag besteht also insgesamt aus 4 Parametern. Die allgemeine Form sieht so aus:
{{fa::name::classes::styles}}
{{fa-brands::name::classes::styles}}
{{fa-regular::name::classes::styles}}
{{fa-solid::name::classes::styles}}
Der erste Parameter »fa«
...ist konstant und kennzeichnet das Tag.
Der zweite Parameter »name«
...muss durch den Namen des Icons ersetzt werden. Dabei sollte der Name des Icons verwendet werden, wie er auf der Seite Font Awesome Icons angegeben ist: https://fontawesome.com/search?m=free&o=r - also ohne Prefix !
Beispiel:
{{fa-solid::check}}
Der dritte Parameter »classes«
...kann (ist optional) eine oder mehrere CSS-Klassen-Namen enthalten. Für das Bereitstellen der Klasse müssen die Administratorinnen und Administratoren selbst Sorge tragen. Mehrere Klassen-Namen können wie im class-Attribute eines HTML-Tags notiert werden - also auch durch Leerzeichen getrennt.
Beispiel:
{{fa-solid::check::class1 class2 class3}}
Der vierte Parameter »styles«
...kann (ist optional) eine oder mehrere Style-Angaben enthalten.
Beispiel:
// for svg (svg: true)
{{fa-solid::check::fa-spin fa-3x fa-fw::width:50px;background-color:orangered;border-radius: 50px;}}
// for icon font
{{fa-solid::check::fa-spin fa-3x fa-fw::font-size:3em;background-color:orangered;border-radius: 50px;}}
Konfiguration
Das Font Awesome Inserttag Bundle kann mit der parameters.yml konfiguriert werden. Diese wird wie folgt mitgeliefert:
Die Konfiguration befindet sich unterhalb des Schlüssels font_awesome_config.
Zurzeit werden dort zwei Schlüssel ausgewertet. Der Schlüssel use und local_source.
use
Mit dem Schlüssel use können die Darstellungsmethoden der Icons festgelegt werden.
Fallback ist icon_font: true.
Soll statt der Icon-Font die Methode SVG als Bild zum Einsatz kommen, so muss icon_font: false und svg: true gesetzt sein.
Es werden nun img-Tags ausgegeben.
Mittels svg_sprites: true und svg: false werden die Icons als SVG-Sprites eingebunden.
Soll die Generierung der SVG Tags per Javascript erfolgen, kannst du zu svg: true zusätzlich js: true nutzen.
Über css: false lässt sich das automatische Laden der Font Awesome CSS-Datei deaktivieren. Wenn ausschließlich
SVG-Icons genutzt werden, ist das CSS in der Regel nicht erforderlich (standardmäßig aktiviert).
Beispiele:
Icon Font
SVG als Bild
SVG-Sprites
SVG + JavaScript
local_source
Über local_source: 'files/dein-pfad-zum-fontawesome-ordner' kannst du den Pfad zu Font Awesome anpassen, um zum
Beispiel die Pro-Variante oder eine andere Font Awesome Version einzubinden. Gib dazu den kompletten Pfad ab files zum
Font Awesome Ordner, wo die Ordner css, js, svgs usw. enthalten sind, an.
Font Awesome Inserttag
This bundle installs an InsertTag that allows Font Awesome icons to be used as a font or via SVG in Contao.
General form of the tag
The tag starts with the prefix fa and it is followed by three more parameters. Parameters 1 and 2 are
required, parameters 3 and 4 are optional and can be omitted. So the tag consists of a total of
4 parameters. The general form looks like this:
{{fa::name::classes::styles}}
{{fa-brands::name::classes::styles}}
{{fa-regular::name::classes::styles}}
{{fa-solid::name::classes::styles}}
The first parameter »fa«
...is constant and identifies the tag.
The second parameter »name«
...must be replaced by the name of the icon. The name of the icon should be used as shown
on the Bootstrap Icons page: https://icons.getbootstrap.com - that is, without the fa- prefix!
Example:
{{fa-solid::check}}
The third parameter »classes«
...may (is optional) contain one or more CSS class names. The administrators must take care of providing the class themselves. Multiple class names can be noted as in the class attribute of an HTML tag - i.e. also separated by spaces.
Example:
{{fa-solid::check::class1 class2 class3}}
The fourth parameter »styles«
...may (is optional) contain one or more style statements.
Example:
// for svg (svg: true)
{{fa-solid::check::fa-spin fa-3x fa-fw::width:50px;background-color:orangered;border-radius: 50px;}}
// for icon font
{{fa-solid::check::fa-spin fa-3x fa-fw::font-size:3em;background-color:orangered;border-radius: 50px;}}
Configuration
The Font Awesome Inserttag Bundle can be configured using parameters.yml. This is supplied as follows:
The configuration is located below the font_awesome_config key.
Currently, two other keys are evaluated there. The local_source key and the use key.
use
The use key can be used to define the four display methods of the icons.
Fallback is icon_font: true.
If the SVG as image method is to be used instead of the icon font, icon_font: false and svg: true must be set.
Now img tags will be output.
Using svg_sprites: true and svg: false you can use icons included as
svg sprites.
If you want the SVG tags to be generated by Javascript, you can use svg: true and js: true.
in addition.
Using css: false, the automatic loading of the Font Awesome CSS file can be disabled. If only SVG icons are used,
the CSS is usually not required (enabled by default).
Examples:
Icon Font
SVG as image
SVG Sprites
SVG + JavaScript