Ah, okay. You want something like this:Thanks, but I want for each node to have different png icon. Not for all the same icons. Would this be possible?
extra.less
:.block-body{
.node--id2 i {background: url(https://i.imgur.com/GiPCGAJ.png)no-repeat center;}
.node--id3 i {background: url(https://i.imgur.com/BuxWZ1Y.png)no-repeat center;}
.node--id6 i{background: url(https://i.imgur.com/a1sqk5J.png)no-repeat center;}
.node--id10 i{background: url(https://i.imgur.com/vCaelJz.png)no-repeat center;}
}
Ah, okay. You want something like this:
It can be done is CSS. You need to put the code below inextra.less
:
Code:.block-body{ .node--id2 i {background: url(https://i.imgur.com/GiPCGAJ.png)no-repeat center;} .node--id3 i {background: url(https://i.imgur.com/BuxWZ1Y.png)no-repeat center;} .node--id6 i{background: url(https://i.imgur.com/a1sqk5J.png)no-repeat center;} .node--id10 i{background: url(https://i.imgur.com/vCaelJz.png)no-repeat center;} }
It should be. Try it out and then check on mobile.Alright, so it can be done with CSS code? Would this be responsible on phone too?
It should be. Try it out and then check on mobile.
Now you're just getting greedy lol. I've not figured that out. You will have to get an addon for thatBy the way, what's the css code for unread and read icon?
I've got node tweak. But doesn't seem to be workingNow you're just getting greedy lol. I've not figured that out. You will have to get an addon for that
Yeah. You need to speak with the developer about that. In the meantime, you can have different images for each node with the code above. That's wut I have on one of my styles.I've got node tweak. But doesn't seem to be working
Yeah. You need to speak with the developer about that. In the meantime, you can have different images for each node with the code above. That's wut I have on one of my styles.
would this work with read and unread , also with TH nodes addon ?
/* Node Forum Icon Use - Start */
.node--unread .node-icon {
opacity: 50%;
}
/* Node Forum Icon Use - End */
If you add below code to extra.less your unread nodes icon will seen %50 opacity. I think this is better than totally different icon.
Less:/* Node Forum Icon Use - Start */ .node--unread .node-icon { opacity: 50%; } /* Node Forum Icon Use - End */
<span class="node-icon" aria-hidden="true"><i></i></span>
<span class="node-icon" aria-hidden="true">
<img class="cticnbrdr" src="/styles/default/xenforo/icon/{$node.node_id}.png" alt="{$node.title}" />
</span>
/* Node Forum Icon Use - Start */
.node--read .node-icon {
opacity: 50%;
}
/* Node Forum Icon Use - End */
If you follow my posts. You can change node icon for each node. And with last extra.less code you can set %50 opacity of read nodes.
open the node_list_forum template
Find below code.
PHP:<span class="node-icon" aria-hidden="true"><i></i></span>
Replace this code with follows.
PHP:<span class="node-icon" aria-hidden="true"> <img class="cticnbrdr" src="/styles/default/xenforo/icon/{$node.node_id}.png" alt="{$node.title}" /> </span>
Icon location: /styles/default/xenforo/icon/ this is icon location in FTP, you replace it with your own.
Icon name: Icon name should match with node id. That's mean your icon name for node id 5 should be 5.png
if you upload icon to ftp as named;
for example
node id 1 --> 1.png
node id 2 --> 2.png
node id 3 --> 3.png
node id 4 --> 4.png
your node icon change automatically. and if you add below code to extra.less, node icon will seen %50 opacity if there is no new posts in forum.
Less:/* Node Forum Icon Use - Start */ .node--read .node-icon { opacity: 50%; } /* Node Forum Icon Use - End */
Then I need to add this to each node separately?
PHP:
<span class="node-icon" aria-hidden="true">
<img class="cticnbrdr" src="/styles/default/xenforo/icon/{$node.node_id}.png" alt="{$node.title}" />
</span>
No.
<span class="node-icon" aria-hidden="true"><i></i></span>
Find above code in node_list_forum template and replace it with below code.
<span class="node-icon" aria-hidden="true">
<img class="cticnbrdr" src="/styles/default/xenforo/icon/{$node.node_id}.png" alt="{$node.title}" />
</span>
Save this template.
Upload your icons to defined folder by you.
No.
<span class="node-icon" aria-hidden="true"><i></i></span>
Find above code in node_list_forum template and replace it with below code.
<span class="node-icon" aria-hidden="true">
<img class="cticnbrdr" src="/styles/default/xenforo/icon/{$node.node_id}.png" alt="{$node.title}" />
</span>
Save this template.
Upload your icons to defined folder by you.
Ah, okay. You want something like this:
It can be done is CSS. You need to put the code below inextra.less
:
Code:.block-body{ .node--id2 i {background: url(https://i.imgur.com/GiPCGAJ.png)no-repeat center;} .node--id3 i {background: url(https://i.imgur.com/BuxWZ1Y.png)no-repeat center;} .node--id6 i{background: url(https://i.imgur.com/a1sqk5J.png)no-repeat center;} .node--id10 i{background: url(https://i.imgur.com/vCaelJz.png)no-repeat center;} }
.m-nodeImgIcons(@node-id; @unreadImage; @readImage: false; @height: 40px; @width: 40px) {
.node--id@{node-id} {
.node-icon i {
&:before {
content: none;
}
.node--read& {
& when (@readImage = false) {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
}
.node--forum&,
.node--category& {
& when (isurl(@unreadImage)) {
background: @unreadImage no-repeat;
}
& when (ispixel(@height)), (ispixel(@width)) {
height: @height;
width: @width;
}
.node--read& when (isurl(@readImage)) {
background: @readImage no-repeat;
}
}
.node--page& {
& when (isurl(@unreadImage)) {
background: @unreadImage no-repeat;
}
& when (ispixel(@height)), (ispixel(@width)) {
height: @height;
width: @width;
}
}
.node--link& {
& when (isurl(@unreadImage)) {
background: @unreadImage no-repeat;
}
& when (ispixel(@height)), (ispixel(@width)) {
height: @height;
width: @width;
}
}
}
}
}
// NODE IDS
.m-nodeImgIcons(2; url("styles/xenforo/forum_new.png"); url("styles/xenforo/forum_old.png"); 42px; 42px);
.m-nodeImgIcons(3; url("styles/xenforo/forum_new.png"); false; 42px; 42px);
.m-nodeImgIcons(4; url("styles/xenforo/forum_new.png"); false; 42px; 42px);
.m-nodeImgIcons(5; url("styles/xenforo/forum_new.png"); false; 42px; 42px);
Less:.m-nodeImgIcons(@node-id; @unreadImage; @readImage: false; @height: 40px; @width: 40px) { .node--id@{node-id} { .node-icon i { &:before { content: none; } .node--read& { & when (@readImage = false) { -webkit-filter: grayscale(100%); filter: grayscale(100%); } } .node--forum&, .node--category& { & when (isurl(@unreadImage)) { background: @unreadImage no-repeat; } & when (ispixel(@height)), (ispixel(@width)) { height: @height; width: @width; } .node--read& when (isurl(@readImage)) { background: @readImage no-repeat; } } .node--page& { & when (isurl(@unreadImage)) { background: @unreadImage no-repeat; } & when (ispixel(@height)), (ispixel(@width)) { height: @height; width: @width; } } .node--link& { & when (isurl(@unreadImage)) { background: @unreadImage no-repeat; } & when (ispixel(@height)), (ispixel(@width)) { height: @height; width: @width; } } } } } // NODE IDS .m-nodeImgIcons(2; url("styles/xenforo/forum_new.png"); url("styles/xenforo/forum_old.png"); 42px; 42px); .m-nodeImgIcons(3; url("styles/xenforo/forum_new.png"); false; 42px; 42px); .m-nodeImgIcons(4; url("styles/xenforo/forum_new.png"); false; 42px; 42px); .m-nodeImgIcons(5; url("styles/xenforo/forum_new.png"); false; 42px; 42px);
We use essential cookies to make this site work, and optional cookies to enhance your experience.