Custom node icons

Ehren

Administrator
Staff member
Customer
Messages
5,029
Website
www.xenfocus.com
Most of the font awesome icons are not working.. For example a icon for linux, f17c is a Linux Icon from solid style fab, which doesn't work with theme. Only working icons are from solid style fas.
If you want to use brand icons, you'll need to specify that in the code. Font Awesome 5 has different fonts for Brands :)

Less:
#XF{
    .node--id13 .node-icon i::before{
        content: '\f17c';
        font-family: "Font Awesome 5 Brands";
    }
}
 

Nerdface

Member
Messages
62
Website
nerdface.co.uk
Subnodes don't have classes so you need to target them using their URL.

Less:
.subNodeLink[href$='subforum-2.9/']::before{
    content: "\f00d";
}

Replace the subforum-2.9 part with the end of the subforums URL. The URL for the above example is:
Code:
https://xenfocus.com/xf2/index.php?forums/subforum-2.9/
Is there a way to accomplish the "read" and "unread" status for custom subnode icons?

I've used the code above, but all subforums appear to always have unread content.
 

Ehren

Administrator
Staff member
Customer
Messages
5,029
Website
www.xenfocus.com
Is there a way to accomplish the "read" and "unread" status for custom subnode icons?
Unread subnodes have the .subNodeLink--unread class attached to them. The below code can be used to change the icon for unread nodes.

Less:
.subNodeLink.subNodeLink--unread[href$='subforum-2.9/']::before{
    content: "\f00d";
}
 

Nerdface

Member
Messages
62
Website
nerdface.co.uk
Unread subnodes have the .subNodeLink--unread class attached to them. The below code can be used to change the icon for unread nodes.

Less:
.subNodeLink.subNodeLink--unread[href$='subforum-2.9/']::before{
    content: "\f00d";
}
Thanks Ehren, I realised it was more an issue with the icons I selected (brands) - they don't have alternative styles.
 

Zetion

New Member
Messages
1
'Hello, @Ehren

I added it but it didn't work.

my forum site: "http://terasus.net/forum/index.php"

1570
 

Ehren

Administrator
Staff member
Customer
Messages
5,029
Website
www.xenfocus.com
@Ehren

This no longer works for sub-nodes. Instead, an icon is placed BEFORE the default.
The code has changed slightly for 2.2. Try this instead (change the subforum-name.9 value and f00d value to your own) :)

Less:
.subNodeLink[href$='subforum-name.9/'] .fa--xf::before{
    content: "\f00d";
}
 

Ehren

Administrator
Staff member
Customer
Messages
5,029
Website
www.xenfocus.com
@Ehren hey, sorry to bother you but I have one question, is there any way to make the icons keep the same color as the initial image? http://prntscr.com/111hkxi They are like losing the color, is there any way I can fix that?
Hello,

The opacity and colour of the icons are changed if there is no new content inside the forum. To remove those filters, add this to your extra.less file:
Less:
@node-icon-read-filter: none;
@node-icon-read-opacity: 1;
 

Qui-Ran Demera

New Member
Messages
7
Dear Ehren,

I did just as you said, well, actually I generally used a new unicode value in the general setting of the Style which worked just fine, EXCEPT ^^ the fact, that the style didn't adapt all the new icons correctly:
Fehler Icons etc.png


Now I thought I could solve that problem using that code of yours in extra.less, but it doesn't work - a good friend of mine said this could be caused by different types of nodes (Article, Poll, etc)...

That's what I used to solve the issue with the boards. For most of them it worked... for some it didn't:
#XF{

.node--id83 .node-icon i::before,

.node--id8 .node-icon i::before,

.node--id7 .node-icon i::before,

.node--id9 .node-icon i::before,

.node--id27 .node-icon i::before,

.node--id31 .node-icon i::before,

.node--id55 .node-icon i::before,

.node--id42 .node-icon i::before,

.node--id43 .node-icon i::before,

.node--id46 .node-icon i::before,

.node--id98 .node-icon i::before{

content: '\f669';

}

}

How can I fix this? :) Thank you!
 

Attachments

  • 1633132228215.png
    1633132228215.png
    253.7 KB · Views: 28
Last edited:
Top