XF 1.3 Show Custom Field to Additional Usergroup

Michael

Active member
Hey guys,

I am wanting to have a custom field hidden and only showing on the Personal Details page to those in an additional usergroup. How can I go about doing this, is there a conditional for this?

@Jake Bunce (you always have a knack for conditionals :D)

Thank you.
 
Admin CP -> Appearance -> Templates -> member_view

Add red code. Specify field_id and group_id in blue:

Rich (BB code):
	<xen:if is="{$customFieldsGrouped.personal}">
		<xen:foreach loop="$customFieldsGrouped.personal" value="$field">
			<xen:if is="{$field.field_id} != 'field_id' OR {xen:helper ismemberof, $user, 3}">
				<xen:include template="custom_field_view" />
			</xen:if>
		</xen:foreach>
	</xen:if>
 
Hey guys,

I am wanting to have a custom field hidden and only showing on the Personal Details page to those in an additional usergroup. How can I go about doing this, is there a conditional for this?

@Jake Bunce (you always have a knack for conditionals :D)

Thank you.

Clarify...

Showing when the logged in user is a member of a group? If so then use $visitor.

Showing when the user whose profile page it is is a member of a group? If so then use $user as in the above code.
 
Top Bottom