XF 1.2 Hide Reply Button for First Post in Specific Forum

QenTox

Well-known member
This add-on can hide the reply button for first post. Can someone please tell me how to modify this if I want to hide reply button only for certain forum?
 

QenTox

Well-known member
Thanks, but I am not really good with this, tried that few times, but I always get this error: The following templates contained errors and were not saved: post: 1) Line 51: Template syntax error.

Could you please post here the exact place, where should I place that .node22 code?
 

Brogan

XenForo moderator
Staff member
Try:
Code:
<xen:if is="{$post.position}!=0 AND {$forum.node_id} == x">
Replace x with the node ID.
 

QenTox

Well-known member
Thanks, no error this time but for some reason still in all forums is the reply button hidden in first post. Tried CTRL + F5, but still no change.
 

QenTox

Well-known member
Actually the code you provided hides the reply button for all posts in all forums except the specified node, where reply button is in all posts except the first post.
 

Brogan

XenForo moderator
Staff member
Oops, yes.
G&T + support = not a good idea.

Just add a new xen:if for the node id, wrapping the original edit.
 

QenTox

Well-known member
Like this?

Code:
<xen:if is="{$forum.node_id}==22">
  <xen:if is="{$post.position}!=0">
    <xen:if is="{$canReply}">
      <a href="{xen:link threads/reply, $thread, 'quote={$post.post_id}'}" data-postUrl="{xen:link posts/quote, $post}" class="ReplyQuote item control reply" title="{xen:phrase reply_quoting_this_message}"><span></span>{xen:phrase reply}</a>
    </xen:if>
  </xen:if>
</xen:if>
It seems like it does the same as the code before.
 

Brogan

XenForo moderator
Staff member
You will also need a xen:else.

xen:if
new node 22 code​
xen:else
original code​
/
 

QenTox

Well-known member
Code:
<xen:if is="{$forum.node_id}==22">
<xen:else />
  <xen:if is="{$post.position}!=0">
    <xen:if is="{$canReply}">
      <a href="{xen:link threads/reply, $thread, 'quote={$post.post_id}'}" data-postUrl="{xen:link posts/quote, $post}" class="ReplyQuote item control reply" title="{xen:phrase reply_quoting_this_message}"><span></span>{xen:phrase reply}</a>
    </xen:if>
  </xen:if>
</xen:if>
Not sure if I did it right, but now I have no reply at all in specified forum and in all other forums there is reply button for all posts except the first.
 
Top