XF 2.2 automatic content

htsumer

Active member
In a single forum, after the person writes the title, a text will be written that I will determine, no matter what he writes in the message section. Like auto content.
Whatever the user writes in this section, the text that I will specify will appear.

1631561821720.webp
 
Solution
Using the Post: Below message content position, probably something like:

HTML:
<xf:if is="$post.Thread.node_id == 2 AND $post.position == 0">
    Text
</xf:if>

Change the 2 to the node ID.
Using the Post: Below message content position, probably something like:

HTML:
<xf:if is="$post.Thread.node_id == 2 AND $post.position == 0">
    Text
</xf:if>

Change the 2 to the node ID.
 
Solution
So if I need to delete the user's first message and then add this code, what should I add to the code to delete the first message? Delete the first message, make the new message active
 
That would require custom development to do properly but you may be able to achieve what you want by editing the post_macros template and wrapping the content in a conditional statement for that node and the first post.
 
Back
Top Bottom