Is this valid code?

Matthew Hawley

Well-known member
Is this valid code, because it wont work.

Code:
<li title="<xen:if is="{$user.customFields.customUserTooltip}" />" class="Tooltip"><a href="{xen:link members, $user}" class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if></li>

If its not, how do I put a custom user field in there.
 
Code:
<xen:if is="{$user.customFields.customUserTooltip}" />
This doesn't do anything the /> at the end denotes the end of the IF... so you should remove that. Not to mention, I don't even see a reason for the IF in the first place... As for the rest, it may work, but its bad form to put brackets inside of brackets. Try this:
Code:
<li title="{$user.customFields.customUserTooltip}" class="Tooltip">
    <a href="{xen:link members, $user}" class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a>
        <xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
</li>
 
Code:
<xen:if is="{$user.customFields.customUserTooltip}" />
This doesn't do anything the /> at the end denotes the end of the IF... so you should remove that. Not to mention, I don't even see a reason for the IF in the first place... As for the rest, it may work, but its bad form to put brackets inside of brackets. Try this:
Code:
<li title="{$user.customFields.customUserTooltip}" class="Tooltip">
    <a href="{xen:link members, $user}" class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a>
        <xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
</li>

Didn't work.
 
The xen:if tag is not self closing so you need a closing tag. You need short hand use the function: {xen:if condition, true, false}.
 
What error you got? Post all code you have :)

There is no error, just the code doesnt work

Code:
<li title="{xen:if '{$user.customFields.customUserTooltip}', {$user.customFields.customUserTooltip}, '{$user.customFields.customUserTooltip}'}" class="Tooltip">
    <a href="{xen:link members, $user}" class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a>
        <xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
</li>
 
Code:
<li title="{xen:if '{$user.customFields.customUserTooltip}', {$user.customFields.customUserTooltip}, ''}" class="Tooltip">
    <a href="{xen:link members, $user}" class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a>
        <xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
</li>
Try it :D
 
Code:
<li title="{xen:if '{$user.customFields.customUserTooltip}', {$user.customFields.customUserTooltip}, ''}" class="Tooltip">
    <a href="{xen:link members, $user}" class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a>
        <xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
</li>
Try it :D

Nope.
 
Top Bottom