XF 2.3 Font Awesome for Prefixes?

Robert9

Well-known member
Funnily enough, it took me years to come up with this idea, but for a new forum, it makes perfect sense to use Font Awesome icons instead of text for prefixes. Unfortunately, phrases like {icon:fas::comments} don’t work.

Is this feature not built in, or should I use a different code?
 
You may use HTML here, but ideally markup should be made in templates rather than phrases.

You may use {icon::name} to display an icon in the default variant, or {icon:variant::name} to display an icon in a specific variant. For example, {icon::alien} or {icon:fas::alien}.
 
{icon::alien}

results in

<i class="fa--xf far fa-alien "><svg xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" ><use href="/data/local/icons/regular.svg?v=1730474133#alien"></use></svg></i>
 
No, this is not what I am talking about.

I am talking to add a prefix; then change the phrase for this prefix and use a typical font awesome or more as the text itself.

If you use the form for add/edit phrases, you can read:

You may use HTML here, but ideally markup should be made in templates rather than phrases.

You may use {icon::name} to display an icon in the default variant, or {icon:variant::name} to display an icon in a specific variant. For example, {icon::alien} or {icon:fas::alien}.

Means you can use a phrase to show an icon somewhere in a template. But you can't use this in a phrase for a prefix.
Means that nobody has cared to translate phrases for prefixes like phrases for text somewhere else.

I guess this is somehow not a bug, but a missing code to handle a phrase everywhere the same way.
 
Back
Top Bottom