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

Signature conditionals in template

Andy.N

Well-known member
#1
I have modified the message template to show the latest status instead of signature.
PHP:
<xen:if is="{$visitor.content_show_signature} && ({$message.signature} OR {$message.status})">
            <div class="baseHtml signature ugc{xen:if $message.isIgnored, ' ignored'}"><aside><xen:if is="{$message.status}">
                    <div>Latest status: {$message.status}</div>
                </xen:if></aside></div>
        </xen:if>
There is a small problem. If someone has a signature but no status, the message template will display the small horizontal blue line (I believe it comes from <div class="baseHtml signature).

I'd like to wrap the conditionals around that as well so it will only show the line if there is a status.
 

Jake Bunce

XenForo moderator
Staff member
#2
Remove the red code:

Code:
<xen:if is="{$visitor.content_show_signature} && ({$message.signature} OR {$message.status})">
            <div class="baseHtml signature ugc{xen:if $message.isIgnored, ' ignored'}"><aside><xen:if is="{$message.status}">
                    <div>Latest status: {$message.status}</div>
                </xen:if></aside></div>
        </xen:if>
Resulting in this:

Code:
<xen:if is="{$visitor.content_show_signature} && {$message.status}">
            <div class="baseHtml signature ugc{xen:if $message.isIgnored, ' ignored'}"><aside><xen:if is="{$message.status}">
                    <div>Latest status: {$message.status}</div>
                </xen:if></aside></div>
        </xen:if>
That way it only displays the signature block if there is a user status.

My posts in this thread might interest you if you wish to expand on your signature modification:

http://xenforo.com/community/thread...us-in-own-signature-maybe-a-suggestion.13701/