[cXF] Change default FA node icon

[cXF] Change default FA node icon

How to change sub-node icon in forum homepage with png images as read and unread?
 

Attachments

  • Screenshot_9.webp
    Screenshot_9.webp
    47.1 KB · Views: 10
Any way to change the sub-node icon in a dropdown menu on the default style?
Try with this code:
Less:
/*** Sub-Node icons ***/
.subNodeLink { 
    &.subNodeLink--forum {
        // for read node
        .subNodeLink-icon {
            color: blue;
        }
        // for unread node
        &.subNodeLink--unread .subNodeLink-icon {
            color: red;
        }
    }
}
/*****/
 
Try with this code:
I appreciate it!

But, can it be done on a per-node basis, or is the only way to achieve it is a blanket of all subnodes? If the latter, I'll just stick with the default.

I'm not trying to achieve a color change, but an icon change. I think if I were able to get the per-node code for color, I could do the icon. But, if XF isn't setup to change icons per sub-node, then it's not needed.
 
Hello,

Can we just batch replace all subcategories with a different image?

View attachment 316031
This topic was helpful, thank you, I need to do a little more research :)

 
Hi @BassMan

In XF 2.2, I used this code from you:

Code:
/*** Change default FA node icon **/
.node {
    &.node--forum, &.node--category {

        .node-icon i:before {
            .m-faBase();
            content: "\f4b0";
        }
    }
    .subNodeLink.subNodeLink--forum .subNodeLink-icon:before {
        .m-faBase();
        content: "\f4b0";
    }
}
/*****/

However, it doesn’t work in XenForo 2.3.
it's there any new css for fix this?

Thanks.
Regards.
 
Hi @maszd,

Yes, check the overview page for XF 2.3 code.
I'm use this code:
Code:
.node .node-icon i { &:before {.m-faContent(@fa-var-duotone-comment-lines, 1em);}
    svg {display: none;}}

.subNodeLink.subNodeLink--forum .subNodeLink-icon:before {.m-faContent(@fa-var-comment-lines, 1em);}
    svg {display: none;}

It works, but the poll icon and other icons in the thread list view have disappeared :(

2026-02-15_191402.webp2026-02-15_191630.webp
 
Just tested and it all works fine.

You are showing me the forum_view, but this code changes the icon for forum node on the forum_list template. And if I add that code, I can still see the poll icon in the forum_view. So there must be someting else.
 
Back
Top Bottom