XF 1.1 If statment - show somthing when post count equals X

Martry

Member
Is it possible to use an {if} statement to show a certain profile field on the edit profile page, like the homepage field, only when the registered user has reached a certain amount of posts.
 

Jake Bunce

XenForo moderator
Staff member
Thanks but when i try to add this code, it just shows the else part:

Code:
<xen:if is="{$user.message_count} > 3">
<dd><input type="url" name="homepage" value="{$visitor.homepage}" id="ctrl_homepage" class="textCtrl" /></dd>
<xen:else />
<dd>You must have at least 3 forum posts to add your website.</dd>
</xen:if>
Are you working in the message_user_info template?

You may want to use $visitor instead of $user , depending on exactly where you are working.
 

Martry

Member
Thank you for your help buddy, you are correct it worked fine when i changed $user to $visitor. :D

I was editing account_personal_details template.

Code:
<xen:if is="{$visitor.message_count} > 3">
<dd><input type="url" name="homepage" value="{$visitor.homepage}" id="ctrl_homepage" class="textCtrl" /></dd>
<xen:else />
<dd>You must have at least 3 forum posts to add your website.</dd>
</xen:if>
 
Top