XF 2.3 Color change question on Whats New

CTS

Active member
Hi. I am hoping to figure out how to change the color of the forum name in listings under the Whats New tab.

The exact positioning I am pointing to is the forum name as it exists under the thread title, located to the right of the thread poster / post date info directly under the thread title.

I tried inspecting the element but all I found was the ability to change post date AND forum name color.

I just wish to change the forum name color and am hoping someone else has figured it out too. Tnx.

edit to add: running on a stock base xenforo style.
 
It appears because that list item has no class, while the date does.

Open thread_list_macros

Find:
HTML:
                    <ul class="structItem-parts">
                        <li><xf:username user="$thread.User" defaultname="{$thread.username}" /></li>
                        <li class="structItem-startDate"><a href="{{ link('threads', $thread) }}" rel="nofollow"><xf:date time="{$thread.post_date}" /></a></li>
                        <xf:if is="!$forum">
                            <li><a href="{{ link('forums', $thread.Forum) }}">{$thread.Forum.title}</a></li>
                        </xf:if>
                    </ul>

Replace:
HTML:
                            <li><a href="{{ link('forums', $thread.Forum) }}">{$thread.Forum.title}</a></li>

With this for red:
HTML:
<li><a href="{{ link('forums', $thread.Forum) }}" style="color: red;">{$thread.Forum.title}</a></li>

1741021905230.webp

It would require more complex CSS editing to do it with a class, and even more by doing it with LESS (node by node different colors).
 
  • Like
Reactions: CTS
@frm Yeah that did the trick. Thank you.
Let me know if you'd like me to explore it deeper to see if it can be done on a per-node basis.

I was thinking of adding data-node-id="{{ $thread.node_id }}" somewhere so that different colors could be applied to different nodes like this to extra.less
Less:
[data-node-id="1"]{
...node color 1 CSS
}
[data-node-id="2"]{
...node color 2 CSS
}

But I had to get into the CSS to do that first (style="color: red;" was the quickest and easiest), and it's now 3 AM and a bit sleep deprived. So, I'll give it a go tomorrow if that's something that'd be helpful to your forum.
 
No, that was all I needed. I just wanted to make the forum name title stand out a bit more. I don't really need the different colors per node. But I do appreciate it.
 
  • Like
Reactions: frm
No, that was all I needed. I just wanted to make the forum name title stand out a bit more. I don't really need the different colors per node. But I do appreciate it.
You might run into issues with style variations unless you pick a color that's fitting for both light and dark mode.

But glad I could help!
 
Back
Top Bottom