Thanks, but he wanted a image, not font awesome. And we are trying to save money manHello,
You can use an add-on to do that :
Regards, SyTry
- https://xenforo.com/community/resources/different-node-icons-per-node.6745/
- https://xenforo.com/community/resources/node-icon.6285/
- https://xenforo.com/community/resources/coloured-node-icons.6255/
- https://xenforo.com/community/resources/cv6-nodeicons.5565/
- https://xenforo.com/community/resources/xfa-nodes-icon-tweak-xf2.5683/
- https://xenforo.com/community/resources/th-nodes-for-grid-custom-styling-and-custom-icons.5837/
Anyone knows how to change this icon to a customized one?
View attachment 187631
/** forum node with id of say 11 **/
.node--forum.node--id11.node--read .node-icon i:before{content: url(./images/forumicons/unread_image.png);}
.node--forum.node--id11.node--unread .node-icon i:before{content: url(./images/forumicons/read_image.png);}
/** forum node with id of say 99 **/
.node--forum.node--id99.node--read .node-icon i:before{content: url(./images/forumicons/unread_image.png);}
.node--forum.node--id99.node--unread .node-icon i:before{content: url(./images/forumicons/read_image.png);}
/**********/
.node .node-icon i { display: none; }
.node .node-icon {
background-image: url('/images/yourpic.png');
background-repeat: no-repeat;
background-position: center;
}
.node--forum.node--read .node-icon {
background-image: url('/images/yourpic.png');
background-repeat: no-repeat;
background-position: center;
opacity: 0.4;
}
/**********/
@Jordyn
What will be the code if I want to add exactly like what you said, but I also want to add different icons only for 2 forums. I tried messing up with this but whatever I do it always ends badly.
/** forum node with id of say 11 **/
.node--forum.node--id11.node--read .node-icon i:before{content: url(./images/forumicons/unread_image.png);}
.node--forum.node--id11.node--unread .node-icon i:before{content: url(./images/forumicons/read_image.png);}
/** forum node with id of say 99 **/
.node--forum.node--id99.node--read .node-icon i:before{content: url(./images/forumicons/unread_image.png);}
.node--forum.node--id99.node--unread .node-icon i:before{content: url(./images/forumicons/read_image.png);}
the code i posted above is for individual forum nodes, change the node number to whatever node you want to change.
CSS:/** forum node with id of say 11 **/ .node--forum.node--id11.node--read .node-icon i:before{content: url(./images/forumicons/unread_image.png);} .node--forum.node--id11.node--unread .node-icon i:before{content: url(./images/forumicons/read_image.png);} /** forum node with id of say 99 **/ .node--forum.node--id99.node--read .node-icon i:before{content: url(./images/forumicons/unread_image.png);} .node--forum.node--id99.node--unread .node-icon i:before{content: url(./images/forumicons/read_image.png);}
/** forum node with id of say 11 **/
.node--forum.node--id11.node--read .node-icon i:before{content: url(./images/forumicons/unread_image.png) 0,0;}
.node--forum.node--id11.node--unread .node-icon i:before{content: url(./images/forumicons/read_image.png) 0,-50;}
/** forum node with id of say 99 **/
.node--forum.node--id99.node--read .node-icon i:before{content: url(./images/forumicons/unread_image.png) 0,0;}
.node--forum.node--id99.node--unread .node-icon i:before{content: url(./images/forumicons/read_image.png) 0,-50;}
What if I use sprite? I tried to adjust the positions but they always end up weird.
/** forum node with id of say 2 **/
.node--forum.node--id2.node--read .node-icon i:before{
background: url('https://www.w3schools.com/css/img_navsprites_hover.gif') no-repeat 0px 0px;
width:43px;
height:43px;
display:block;
position:absolute;
content: " ";
top:20px;
left:10px;
}
.node--forum.node--id2.node--unread .node-icon i:before{
background: url('https://www.w3schools.com/css/img_navsprites_hover.gif') no-repeat -91px 0px;
width:43px;
height:43px;
display:block;
position:absolute;
content: " ";
top:20px;
left: 10px;
}
You can just use both codes mate.@Jordyn
What will be the code if I want to add exactly like what you said, but I also want to add different icons only for 2 forums. I tried messing up with this but whatever I do it always ends badly.
/* Node All Forums */
.node .node-icon i { display: none; }
.node .node-icon {
background-image: url('/images/yourpic.png');
background-repeat: no-repeat;
background-position: center;
}
.node--forum.node--read .node-icon {
background-image: url('/images/yourpic.png');
background-repeat: no-repeat;
background-position: center;
opacity: 0.4;
}
/* Node All Forums End */
/* Node icons */
.node--id4 .node-icon i { display: none; }
.node--id4 .node-icon {
background-image: url('/images/yourimage.png');
background-repeat: no-repeat;
background-position: center;
}
.node--forum.node--id4.node--read .node-icon {
background-image: url('/images/yourimage.png');
background-repeat: no-repeat;
background-position: center;
opacity: 0.4;
}
/* Node icons End */
/* Node icons */
.node--id5 .node-icon i { display: none; }
.node--id5 .node-icon {
background-image: url('/images/yourimage.png');
background-repeat: no-repeat;
background-position: center;
}
.node--forum.node--id5.node--read .node-icon {
background-image: url('/images/yourimage.png');
background-repeat: no-repeat;
background-position: center;
opacity: 0.4;
}
/* Node icons End */
.node-icon i{
background-image: url(images/iconsprites.png);
background-position: 0px 0px;
height: 32px;
line-height: 40px;
width: 32px;
}
You would just use this code without the opacity: 0.4; and add your 1 image to both mate.I manage to setup the default icon and it is in position but with both of the codes you provided for specific node icon the icon is always out of position, it's like it doesn't follow the css of the default icon. I am using this css for the default icon because I decided to have only 1 icon, not 2 for read and unread.
Code:.node-icon i{ background-image: url(images/iconsprites.png); background-position: 0px 0px; height: 32px; line-height: 40px; width: 32px; }
/* Node All Forums */
.node .node-icon i { display: none; }
.node .node-icon {
background-image: url('/images/yourpic.png');
background-repeat: no-repeat;
background-position: center;
}
.node--forum.node--read .node-icon {
background-image: url('/images/yourpic.png');
background-repeat: no-repeat;
background-position: center;
}
/* Node All Forums End */
I manage to setup the default icon and it is in position but with both of the codes you provided for specific node icon the icon is always out of position, it's like it doesn't follow the css of the default icon. I am using this css for the default icon because I decided to have only 1 icon, not 2 for read and unread.
Code:.node-icon i{ background-image: url(images/iconsprites.png); background-position: 0px 0px; height: 32px; line-height: 40px; width: 32px; }
.node .node-icon i:before { content: " "; }
.node--forum.node--id2.node--read .node-icon i{
background: url('https://www.w3schools.com/css/img_navsprites_hover.gif') no-repeat 0px 0px;
position: relative;
left: -5px;
display: table-cell;
vertical-align: middle;
padding: 8px 14px 0px 0px;
opacity: 0.4;
}
.node--forum.node--id2.node--unread .node-icon i{
background: url('https://www.w3schools.com/css/img_navsprites_hover.gif') no-repeat -91px 0px;
position: relative;
left: -5px;
display: table-cell;
vertical-align: middle;
padding: 8px 14px 0px 0px;
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.