[go: up one dir, main page]

XF 2.3 Icons not showing after update

mejmet

New member
After updating to 2.3, icons are not visible in the forum. I looked at many sources but could not find a solution. What can I do about this?
 
The icon system has changed in 2.3. It looks like your style or customizations are outdated and will need updating.

You should use .m-faIcon to set icons in CSS. For example:

Less:
.p-navEl-link[data-nav-id="home"]::before
{
    .m-faIcon(@fa-var-home);
}
 
The icon system has changed in 2.3. It looks like your style or customizations are outdated and will need updating.

You should use .m-faIcon to set icons in CSS. For example:

Less:
.p-navEl-link[data-nav-id="home"]::before
{
    .m-faIcon(@fa-var-home);
}
Thank you, where do I add this?
 
Anywhere you've used CSS icons. That example is from your current extra.less which appears to use CSS content properties.

You'll also need to update any <i class="fa ..."></i> usages to use <xf:fa icon="..." />. You can see here for more details:

 
Anywhere you've used CSS icons. That example is from your current extra.less which appears to use CSS content properties.

<i class="fa ..."></i> usages to use <xf:fa icon="..." />. You can see here for more details:

Can I install the old version? Because I think it will be difficult this way..
 
The legacy icon approach is not compatible with 2.3, and both .m-faContent(@fa-var-name) and <xf:fa> were the recommended way to use icons in 2.1/2.2 and and would have continued to work in 2.3.

It should not be too difficult to switch over, and if you have any questions about it feel free to ask.

I bought a theme. I don't know where to upload the codes...
You should contact the style author for an updated version.
 
The legacy icon approach is not compatible with 2.3, and both .m-faContent(@fa-var-name) and <xf:fa> were the recommended way to use icons in 2.1/2.2 and and would have continued to work in 2.3.

It should not be too difficult to switch over, and if you have any questions about it feel free to ask.


You should contact the style author for an updated version.
I may get a late response from the theme maker. Can you tell me how I can add it?
 
You must edit the extra.less template and replace all of the content-based icons with .m-faIcon.

For example, you might see:
Less:
.p-navEl-link[data-nav-id="home"]:before {
    content: '\f015';
}

You would need to look up the icon corresponding to the character, \f015, and replace it with the variable corresponding to its name, home:
Less:
.p-navEl-link[data-nav-id="home"]:before {
    .m-faIcon(@fa-var-home);
}
 
The CSS shows that (or similar code) in extra.less, but it may be the result of inclusions from other files. You might try using the template search for data-nav-id="home" to see if you can identify the source.
 
You can search templates via Control panel > Appearance > Styles and templates > Search templates (admin.php?templates/search).

Though if the style is made for 2.2, then it will need updates for compatibility with 2.3 stretching far beyond icons. You will need to get an update from the creator, or use the default style in the meantime.
 
Anywhere you've used CSS icons. That example is from your current extra.less which appears to use CSS content properties.

You'll also need to update any <i class="fa ..."></i> usages to use <xf:fa icon="..." />. You can see here for more details:

Can you explain please how it works in Custom user fields? I had before:
Code:
<a href="skype:{$valueUrl}?chat"><i class="fab fa-skype"></i></a>
Changed
Code:
<a href="skype:{$valueUrl}?chat"><xf:fa icon="fab fa-skype" /></a>
Doesn't work :(
With simple text works fine.
 
The easiest solution for places which don't support XF template syntax (<xf:fa>) is to use the JS renderer:

HTML:
<a href="skype:{$valueUrl}?chat">
    <i class="fa--xf fab fa-skype" title="Skype" data-xf-init="icon" data-lazy="false"><svg></svg></i>
</a>
 
The easiest solution for places which don't support XF template syntax (<xf:fa>) is to use the JS renderer:

HTML:
<a href="skype:{$valueUrl}?chat">
    <i class="fa--xf fab fa-skype" title="Skype" data-xf-init="icon" data-lazy="false"><svg></svg></i>
</a>
Ahhh, I realized there is simply no support for Custom user fields. Thank you very much for the solution!
 
Back
Top Bottom