XF 2.3 How to hide the "Not open for further replies" message for locked threads in some nodes?

securedme

Well-known member
Licensed customer
I would like to hide the following message block for locked threads in certain nodes.

1756513528184.webp
 
The easiest way is with CSS. The "Not open for further replies" block uses the class .blockStatus-message--locked, and XenForo adds data-container-key="node-XX" to the page. So in extra.less:
Code:
.template-thread_view[data-container-key="node-42"],
.template-thread_view[data-container-key="node-55"] {
    .blockStatus-message--locked {
        display: none;
    }
}
Replace 42 and 55 with the node IDs where you want to hide it.
If you'd rather remove it from the HTML entirely, you can do a template modification on thread_view. The notice lives inside a thread_status macro in that template. Find:
<xf:if is="!$thread.discussion_open">
And replace with:
<xf:if is="!$thread.discussion_open AND !in_array($forum.node_id, [42, 55])">
Both approaches work — the CSS one is quicker, the template mod is cleaner.
 
Back
Top Bottom