Page 1 of 1

Font Awesome in Menu Item link > Joomla 4

Posted: Sun Jul 12, 2020 9:56 pm
by joomleb
Hi guys,
as far as I know in Joomla 3.9.19 are still present these 2 "issues": viewtopic.php?t=969189

Do you know if anything is changing with the upcoming Joomla 4 ?

Re: Font Awesome in Menu Item link > Joomla 4

Posted: Sun Jul 12, 2020 11:12 pm
by sozzled
I don't know if anything is changing with J! 4 (whenever J! 4 stable is released)—as far as FontAwesome support is concerned—but I think that these issues are related, in part, to the template(s) people may be using with whatever version of J! they're employing.

The simple answer to how to include FontAwesome font with Joomla! is here: https://stackoverflow.com/questions/470 ... n-from-css

Therefore, the question about whether one template or another uses FontAwesome can either be (a) answered by the developer(s) of that particular template, or (b) addressed by including a statement (something like)

Code: Select all

<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
in the template's HTML (where path/to/ is points to the actual location of the CSS filename). 8)

Both the J! 4 Cassiopeia [frontend] template and the Atum [backend] template include FontAwesome font support. I don't know anything about third-party templates or whether third-party developers have included FontAwesome support with their templates (whether we're discussing J! 3.x or J! 4) at this time.

Re: Font Awesome in Menu Item link > Joomla 4

Posted: Mon Jul 13, 2020 12:46 am
by joomleb
Hi sozzled,
many thanks for your answer. Anyway, I have no doubts on how to include Font Awesome icons support on my template and also how to add them to a menu link, is pretty easy:

Menu Item > Link Type > Link class: fa fa-home (for example)

The question was and is about the 2 issues we have back:

1 - the Icon and the Title menu item are shown adherent, without a space (a temporary trick is to add a space in the Menu Item Title field)

2 - Font Awesome is a serif font, when you place the icon in front of a menu item, that single menu item Title is inheriting that font

Re: Font Awesome in Menu Item link > Joomla 4

Posted: Mon Jul 13, 2020 1:34 am
by sozzled
joomleb wrote: Mon Jul 13, 2020 12:46 amI have no doubts on how to include Font Awesome icons support on my template ...
Are we discussing J! 3.x or J! 4? ???

If we are discussing J! 4, I think I have answered your question as best as I can. 8)

Re: Font Awesome in Menu Item link > Joomla 4

Posted: Mon Jul 13, 2020 8:09 am
by Webdongle
joomleb wrote: Sun Jul 12, 2020 9:56 pm ...
as far as I know in Joomla 3.9.19 are still present these 2 "issues"...
Not including a non standard font is not an issue. It is a matter of choice ... if you wish to use a Template with (or edit a copy of Joomla's Template to use) a non standard font you are free to do so.

Re: Font Awesome in Menu Item link > Joomla 4

Posted: Mon Jul 13, 2020 1:53 pm
by ceford
Interesting problem! I went to the Cassiopeia template and added user.css with this content:

Code: Select all

.fa-atom::before {
	font-family: "Font Awesome 5 Free";
	content: "\f5d2";
	margin-right: 10px;
	font-weight: 900;
}
And then to Menus: Edit Item -> Link Type and set Link Class to fa-atom - and this is how it came out in the menu:
menu-icon.png
Problem solved?

Re: Font Awesome in Menu Item link > Joomla 4

Posted: Mon Jul 13, 2020 1:59 pm
by ceford
On reflection I should have used a unique style name to avoid interference with any other instances of fa-atom. So atompic perhaps.

Re: Font Awesome in Menu Item link > Joomla 4

Posted: Fri Jun 04, 2021 6:24 am
by modernmagic
joomleb wrote: Mon Jul 13, 2020 12:46 am 2 - Font Awesome is a serif font, when you place the icon in front of a menu item, that single menu item Title is inheriting that font
I too saw this font famliy issue. This was my solution:

Code: Select all

.fa {font-family: inherit;}
.fa::before {font-family: "Font Awesome 5 Free";}

Re: Font Awesome in Menu Item link > Joomla 4

Posted: Fri Sep 24, 2021 2:31 pm
by Jaydot
ceford wrote: Mon Jul 13, 2020 1:53 pm

Code: Select all

font-family: "Font Awesome 5 Free";
I know this is an old post, but I've been searching all over the place to find the correct font-family, so thanks!
How/where did you find out you needed to use "FA 5 Free", and not for instance "FA 5 Regular"??