- Messages
- 5,029
- Website
- www.xenfocus.com
Adding this to your extra.less file should do the trick:SentThank you!
![]()
Less:
.subNodeLink.subNodeLink--category::before {
content: '\f669';
}
Adding this to your extra.less file should do the trick:SentThank you!
![]()
.subNodeLink.subNodeLink--category::before {
content: '\f669';
}
I have a set of custom node icons correctly showing up on desktop browsers but surprisingly not at all on mobile phones.
These icons associate with pages in a custom category which displayed in the header navigation bar along with "Forums", "Members", and "What's New."
@Ehren I'll send you a screenshot and a link so that you can examine the situation yourself.
I am attempting to add custom photos png for node categories but when I add the code supplied it doesn't update anything. Am I do something wrong?Custom FontAwesome Icons
To assign different FontAwesome icons to different nodes, you first need to know the id of your node, and the unicode value of your FontAwesome icon.
The node id can typically be found in the URL. On this site, the client area URL is:
Code:https://xenfocus.com/community/forums/customer-lounge.13/
The id for this is 13, as seen at the end of that URL.
The icon which I want to use is a bell, which has a unicode value of f0f3
So, to change the icon for the Client Lounge on this site, I would add the following to extra.less
Less:#XF{ .node--id13 .node-icon i::before{ content: '\f0f3'; } }
Using images as node icons
Instead of using FontAwesome icons, you can use images as node icons. Each node can use its own image if necessary, and a fallback image will be used for nodes which don't have their own icon. To begin, you'll first need to specify the fallback image for your node icons. This can be done under Style Properties > Node Icons > Image Path (new content). Adding a URL or path to this setting will remove the FontAwesome icons and replace them with your image.
An optional "no new content" image can be specified which will be used on nodes which have no new content. If no image is provided, a faint, grayscale version of your default image will be used.
To customize each node with its own image, add the following to extra.less and customize the 13 (make sure to edit both instances) and the url. This example will use the same node ID as the FontAwesome steps above: node 13.
Less:#XF .node--id13 .node-icon i{ background-image: url('https://site.com/images/node-icons/node-icon-13.png'); } #XF[data-logged-in='true'] .node--id13.node--read .node-icon i{ filter: @node-icon-read-filter; opacity: @node-icon-read-opacity; }
To use custom node images for multiple forums, follow the pattern below:
Less:#XF .node--id13 .node-icon i{ background-image: url('https://site.com/images/node-icons/node-icon-13.png'); } #XF .node--id14 .node-icon i{ background-image: url('https://site.com/images/node-icons/node-icon-14.png'); } #XF .node--id15 .node-icon i{ background-image: url('https://site.com/images/node-icons/node-icon-15.png'); } #XF[data-logged-in='true'] .node--id13.node--read .node-icon i, #XF[data-logged-in='true'] .node--id14.node--read .node-icon i, #XF[data-logged-in='true'] .node--id15.node--read .node-icon i{ filter: @node-icon-read-filter; opacity: @node-icon-read-opacity; }
Hello,I am attempting to add custom photos png for node categories but when I add the code supplied it doesn't update anything. Am I do something wrong?
www.fortnitechatter.comHello,
If possible, can you please post your URL so I can check your code?
Hello,www.fortnitechatter.com
I removed the code because it wasn't working. I was using image URL's. Is there a specific place I need to add images, possibly in cPanel or something to use towards the coding?
#XF .node--id2 .node-icon i{
background-image: url('https://poissondore.fr/data/xfmg/thumbnail/0/52-d23ece9f66b0f268067da0ed19b1db8c.jpg?1650559100');
}
#XF .node--id5 .node-icon i{
background-image: url('https://poissondore.fr/data/xfmg/thumbnail/0/35-4c413fc66f213ff25ac8596a0dcd5493.jpg?1650559095');
}
#XF[data-logged-in='true'] .node--id2.node--read .node-icon i,
#XF[data-logged-in='true'] .node--id5.node--read .node-icon i{
filter: @node-icon-read-filter;
opacity: @node-icon-read-opacity;
}
.subNodeLink.subNodeLink--page[href="/pages/fiche-courte/"]::before{
content: '\f5ca';
}
#XF[data-logged-in='true'] .node--id2.node--read .node-icon i,
#XF[data-logged-in='true'] .node--id5.node--read .node-icon i{
filter: @node-icon-read-filter;
opacity: @node-icon-read-opacity;
}
Hello,
To assign custom icons to "sub-page nodes", use this:
Less:.subNodeLink.subNodeLink--page[href="/pages/fiche-courte/"]::before{ content: '\f5ca'; }
That will set the Fiche Courte icon to an umbrella.
The faint/opacity effect is applied to indicate that there are no new posts in that forum. It only applies to logged in members.
It's useful, but if you want to remove it, remove this block of code:
Less:#XF[data-logged-in='true'] .node--id2.node--read .node-icon i, #XF[data-logged-in='true'] .node--id5.node--read .node-icon i{ filter: @node-icon-read-filter; opacity: @node-icon-read-opacity; }
.subNodeLink[href$='personnages-masculins.20/']::before{
content:"";
display:inline-block;
margin: -6px 6px;
width:18px;
height:18px;
background:url(https://contenu.poissondore.fr/img/icons/24_man.png) no-repeat;
background-size:100%;
}
.subNodeLink-icon::before{
content:"";
}
// Change subforum icons
.node--id7 .subNodeLink .fa-comments::before{
content: '\f1ea' !important;
}
// Remove subforum icons
.node--id7 .subNodeLink .fa-comments{
display: none;
}
Hi @AlteredFancy
Adding this to extra.less will change the subforum icons under node 7 to a newspaper icon (f1ea). The !important code is necessary in this case.
Less:// Change subforum icons .node--id7 .subNodeLink .fa-comments::before{ content: '\f1ea' !important; }
To remove the icons, use this instead:
Less:// Remove subforum icons .node--id7 .subNodeLink .fa-comments{ display: none; }
// Change subforum icons
.node--id19 .subNodeLink .node--read .fa-comments{
content: url('https://contenu.poissondore.fr/img/icons/41_pipe.png') !important;
}
I wanted my sub icon to be replaced by an image but even with the right ID, it does not seem to be of any use.Sorry - I should mention that you'll need to update the id's from the code so they match your own id. If you don't need to target a certain node, just remove .node--id7 from the code.
I wanted my sub icon to be replaced by an image but even with the right ID, it does not seem to be of any use.
.subNodeLink[href="/forums/requetes.19/"] .fa-comments{
background-image: url('https://contenu.poissondore.fr/img/icons/41_pipe.png');
background-size: contain;
background-repeat: no-repeat;
background-position: 50%;
font-size: 0;
width: 20px;
height: 20px;
display: inline-block;
vertical-align: top;
margin-right: 5px;
}