XF 2.1 XF 2.1 Conditional to only show content on 1st post/thread starter

rdn

Well-known member
On message_macros template.
This doesn't work:
Code:
<xf:if is="$post.position % $xf.options.messagesPerPage == 0">
Or
Code:
<xf:if is="{$post.position} % {$xf.options.messagesPerPage} == 0">
 
@rdn ACP > Advertising > Add advertisement, select "Post below message content" and set the value of HTML to
Code:
<xf:if is="$post.Thread && $post.post_id === $post.Thread.first_post_id">
    Mozambique here
</xf:if>
and then apply save.
 
@rdn ACP > Advertising > Add advertisement, select "Post below message content" and set the value of HTML to
Code:
<xf:if is="$post.Thread && $post.post_id === $post.Thread.first_post_id">
    Mozambique here
</xf:if>
and then apply save.
This will do: <xf:if is="{$__globals.thread} AND {$__globals.post} AND {$__globals.thread.first_post_id} == {$__globals.post.post_id}">
What is the difference of this 2 code by the way?

Thanks!
 
This will do it when you have at least 4 posts in the thread.

Code:
<xf:if is="$post.position == $xf.options.messagesPerPage - 1 OR $post.position % $xf.options.messagesPerPage + 1 == count($__globals.posts) AND count($__globals.posts) >= 4">
 
  • Like
Reactions: rdn
Back
Top Bottom