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

Is this valid code?

Matthew Hawley

Well-known member
#1
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.
 

Jaxel

Well-known member
#2
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>
 

Matthew Hawley

Well-known member
#3
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.
 

Jeremy

Well-known member
#4
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}.
 
#11
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>
 

Nobita.Kun

Well-known member
#12
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
 
#13
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.