XF 2.1 Starting content when making a new thread?

Xyphien

Active member
I want to make it so whenever ANYONE goes and makes a new thread in a specific node this text shows up instantly. So they're able to edit and post everything, and it's all the same around the board.

1579145300522.webp

I know this was a function in Xenforo. I'm not sure if it was or is a core function, or if I would need an addon, but I cannot for the life of me remember what this would even be called, or how to go about searching for something like this in both the acp or on xenforo's resources.

If someone could help me out, that'd be lovely!
 
Custom thread field would do what you want though slightly differently in that the text fields show below the post when starting a thread, but can then show inside the first post once the post is ceated
 
Last edited:
Before someone hops on making a paid addon for this... It's one simple line (3 if node-specific). I'm unsure how to use the bb_code {{ }} function or whether it'll convert to all [b]s as opposed to taking the <b></b>s you might try inserting into this code instead of the double line breaks provided, only to find out that they'll be conjoined after toggling BB code into one giant [B][/B] phrase.

I'm giving you a fair warning: don't waste your time.

This will be the outcome (you can live with it until someone confirms that bb_code may or may not help.
1579189694159.png

Lines 1 and 3 aren't needed unless you want it in a specific node. Just place the following at the bottom of the forum_post_thread template, changing 3 to the node you want to use this in.

HTML:
<xf:if is="$forum.node_id == 3">
    <xf:js>$("textarea[name='message_html']").html("HTCG Name:<br /><br />Specific User Rules:<br /><br />HTCG Information:<br /><br />HTCG Pictres:<br /><br />HTCG Rules of the game:<br /><br />");</xf:js>
</xf:if>

(Works on 2.1.5a)
 
Last edited:
Before someone hops on making a paid addon for this... It's one simple line (3 if node-specific). I'm unsure how to use the bb_code {{ }} function or whether it'll convert to all [b]s as opposed to taking the <b></b>s you might try inserting into this code instead of the double line breaks provided, only to find out that they'll be conjoined after toggling BB code into one giant [B][/B] phrase.

I'm giving you a fair warning: don't waste your time.

This will be the outcome (you can live with it until someone confirms that bb_code may or may not help.
View attachment 216779

Lines 1 and 3 aren't needed unless you want it in a specific node. Just place the following at the bottom of the forum_post_thread template, changing 3 to the node you want to use this in.

HTML:
<xf:if is="$forum.node_id == 3">
    <xf:js>$("textarea[name='message_html']").html("HTCG Name:<br /><br />Specific User Rules:<br /><br />HTCG Information:<br /><br />HTCG Pictres:<br /><br />HTCG Rules of the game:<br /><br />");</xf:js>
</xf:if>

(Works on 2.1.5a)
Alrighty, this works. And to answer your question, I added and in the "" and it worked flawlessly.

Code:
<xf:if is="$forum.node_id == 15">
    <xf:js>$("textarea[name='message_html']").html("[b]HTCG Name:[/b]<br /><br />[b]Specific User Rules:[/b]<br /><br />[b]HTCG Information:[/b]<br /><br />[b]HTCG Pictres:[/b]<br /><br />[b]HTCG Rules of the game:[/b]<br /><br />");</xf:js>
</xf:if>

This is the finished product, and turns out exactly how I wanted it to :)

1579213322512.webp

Thanks so much for the help @frm
 
  • Like
Reactions: frm
Top Bottom