• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Conditionals question XF 2.0

[xFv]

Previously Cylent1
#1
Hello!
I know conditionals changed somewhat in xf 2.0
What would be the equivalent of this
Code:
<xen:if is="{$post.user_id} == {$thread.User_id}">
in XF 2.0?
I have tried changing <xen to <xf and still didnt work.
Any help is much appreciated
 

DL6

Well-known member
#4
That doesnt work neither.
I even added the is in the beginning of the syntax that you left out.
any other ideas?
if you are trying to add a Original poster/Thread starter indicador this works for me
in template message_macros find and add the red
Code:
<xf:macro name="user_info" arg-user="!" arg-fallbackName="" arg-dateHtml="" arg-linkHtml="" arg-myVar="">
    <span class="message-userArrow"></span>
    <section itemscope itemtype="https://schema.org/Person" class="message-user">
        <div class="message-avatar">
            <div class="message-avatar-wrapper">
                <xf:avatar user="$user" size="m" defaultname="{$fallbackName}" itemprop="image" />
                <xf:if is="$xf.options.showMessageOnlineStatus && $user && $user.isOnline()">
                    <span class="message-avatar-online" data-xf-init="tooltip" title="{{ phrase('online_now') }}"></span>
                </xf:if>
            </div>
            <xf:if is="$user.user_id == $myVar">
                <span>Thread Starter</span>
            </xf:if>
in the template message post_macros find and add in red:
Code:
<xf:macro template="message_macros" name="user_info" arg-user="{$post.User}" arg-fallbackName="{$post.username}" arg-dateHtml="{$dateHtml}" arg-linkHtml="{$linkHtml}" arg-myVar="{$post.Thread.user_id}" />
result:
1503034980080.png
 

[xFv]

Previously Cylent1
#6
if you are trying to add a Original poster/Thread starter indicador this works for me
in template message_macros find and add the red
Code:
<xf:macro name="user_info" arg-user="!" arg-fallbackName="" arg-dateHtml="" arg-linkHtml="" arg-myVar="">
    <span class="message-userArrow"></span>
    <section itemscope itemtype="https://schema.org/Person" class="message-user">
        <div class="message-avatar">
            <div class="message-avatar-wrapper">
                <xf:avatar user="$user" size="m" defaultname="{$fallbackName}" itemprop="image" />
                <xf:if is="$xf.options.showMessageOnlineStatus && $user && $user.isOnline()">
                    <span class="message-avatar-online" data-xf-init="tooltip" title="{{ phrase('online_now') }}"></span>
                </xf:if>
            </div>
            <xf:if is="$user.user_id == $myVar">
                <span>Thread Starter</span>
            </xf:if>
in the template message post_macros find and add in red:
Code:
<xf:macro template="message_macros" name="user_info" arg-user="{$post.User}" arg-fallbackName="{$post.username}" arg-dateHtml="{$dateHtml}" arg-linkHtml="{$linkHtml}" arg-myVar="{$post.Thread.user_id}" />
result:
View attachment 156062
You have a workaround for this?
XF2 beta3 dont like it at all.