Keşfet

How to dynamically use FontAwesome icons in CSS with XenForo templates?

XFdestek

Kurucu Üye
Katılım
25 May 2014
Mesajlar
5,643
Tepkime puanı
287
Konum
Türkiye
Web sitesi
fivetu.xyz
Hi all,

I'm developing a XenForo 2.3 add-on and need to show icons dynamically based on template variables.

I have a variable like {$item.iconClass} that contains icon classes such as "fal fa-award".

In HTML, this works fine:

<xf:fa icon="{$item.iconClass}" />

But I want to use these icons in CSS pseudo-elements with the .m-faContent() LESS mixin, like this:

Less:

Kod:
Lütfen içeriği görebilmek için Giriş yap yada Kayıt ol to view codes content!

This doesn't work because .m-faContent() expects a...

Lütfen içeriği görebilmek için Giriş yap yada Kayıt ol
 

Konu görüntüleyen kullanıcılar

Benzer konular

Geri
Üst Alt