XF 2.0 Change the node icons

OldCoals

Active member
Back in version 1.x there was an addon to change the read/unread node icons.

Is there similar for version 2 or is there an inbuilt feature?
 
I believe you could modify some of this in the default theme to make it work for you. There is also other discussions people have started to make each individual node a different icon too.
 

Attachments

  • 2f0333227b4d571897e43b8652b71bd6.webp
    2f0333227b4d571897e43b8652b71bd6.webp
    44.8 KB · Views: 350
The node icons are font awesome. You can add this code to the extra.less template:

Code:
.node--forum .node-icon i::before, .node--category .node-icon i::before {
content: "\f085";
}

Replace the "\f085" unicode with one of these icons:

http://fontawesome.io/icons/

Thank you for the code, unfortunately it applies to all categories of the forum.

I wish I could customize each category with a different icon
So I tried this code

but it did not work :
CSS:
.node--forum .node-icon i::before, .node--category14 .node-icon i::before {
content: "\f085";
}
 
Thank you for the code, unfortunately it applies to all categories of the forum.

I wish I could customize each category with a different icon
So I tried this code

but it did not work :
CSS:
.node--forum .node-icon i::before, .node--category14 .node-icon i::before {
content: "\f085";
}

A solution ?

@BassMan

Can not we do like your template modification to color the categories?

You might want to give people time to reply to your posts before you bump them, someone usually answers posts when they have some free time. :)
 
Thank you for the code, unfortunately it applies to all categories of the forum.

I wish I could customize each category with a different icon
So I tried this code

but it did not work :
CSS:
.node--forum .node-icon i::before, .node--category14 .node-icon i::before {
content: "\f085";
}
You can inspect the node icon in your browser and get the node id, then use the following code...
CSS:
.node--id132 .node-icon i::before {
content: "\f085" !important;
}
 
I am trying to assign font awesome node icons individually per node.

Code:
.node--id60.node--unread .node-icon i::before {
    font-size: 34px;
    content: "\f01b";
    padding: 4px;
    color: #4f80b4;
}
.node--id60.node--read .node-icon i::before {
    font-size: 34px;
    content: "\f01b";
    padding: 4px;
}

I also tried adding !important, as I read that somewhere.
Code:
    content: "\f01b" !important;

Something is wrong though, I am getting a replacement of the screenshot below which is not my desired FA, and any unicode I use produces the same thing.

191216
 
I am trying to assign font awesome node icons individually per node.

Code:
.node--id60.node--unread .node-icon i::before {
    font-size: 34px;
    content: "\f01b";
    padding: 4px;
    color: #4f80b4;
}
.node--id60.node--read .node-icon i::before {
    font-size: 34px;
    content: "\f01b";
    padding: 4px;
}

I also tried adding !important, as I read that somewhere.
Code:
    content: "\f01b" !important;

Something is wrong though, I am getting a replacement of the screenshot below which is not my desired FA, and any unicode I use produces the same thing.

View attachment 191216

Make sure you're looking at the correct codes for Font Awesome

For 2.1: https://fontawesome.com/cheatsheet

For 1.5/2.0 (if your XF1 style supports it, it's probably using 4.7): https://fontawesome.com/v4.7.0/cheatsheet/

f01b is not found on the 2.x cheatsheet.
 
Last edited:
.node-icon i { display: none; }
.node--id15 .node-icon {
background-image: url('YOUR LOCATION');
background-repeat: no-repeat;
background-position: center;
}

this works for me..

dont forget to change the node ID to your own....
 
I am trying to assign font awesome node icons individually per node.

Code:
.node--id60.node--unread .node-icon i::before {
    font-size: 34px;
    content: "\f01b";
    padding: 4px;
    color: #4f80b4;
}
.node--id60.node--read .node-icon i::before {
    font-size: 34px;
    content: "\f01b";
    padding: 4px;
}

I also tried adding !important, as I read that somewhere.
Code:
    content: "\f01b" !important;

Something is wrong though, I am getting a replacement of the screenshot below which is not my desired FA, and any unicode I use produces the same thing.

View attachment 191216
And this one :
Code:
.node--id60.node--unread .node-icon i::before {
    font-size: 34px;
    font-family: "FontAwesome";
    content: "\f01b";
    padding: 4px;
    color: #4f80b4;
}
.node--id60.node--read .node-icon i::before {
    font-size: 34px;
    font-family: "FontAwesome";
    content: "\f01b";
    padding: 4px;
}
 
Back
Top Bottom