nocte
Well-known member
I want to add a new "Display Location" for custom user fields (beside from 
I found this thread for XF 1: https://xenforo.com/community/threads/new-display-location-for-custom-user-fields.131696/ - but I cannot find out how to add the 4th display location here:

I have added a code event listener with event entity_structure and event hint
The method in my Listener class looks like this:
	
	
	
		
When I print and die, I see that 'my_new_display_group' is added to $structure - so that part works, but the group is not displayed in the AdminCP.
This is the important part of the
	
	
	
		
So, I need to change the value of
				
			['personal', 'contact', 'preferences'])I found this thread for XF 1: https://xenforo.com/community/threads/new-display-location-for-custom-user-fields.131696/ - but I cannot find out how to add the 4th display location here:

I have added a code event listener with event entity_structure and event hint
XF\Entity\UserField.The method in my Listener class looks like this:
		PHP:
	
	    public static function userFieldEntityStructure(\XF\Mvc\Entity\Manager $em, \XF\Mvc\Entity\Structure &$structure)
    {
        $structure->columns['display_group']['allowedValues'][] = 'my_new_display_group';
        //print_r($structure);
        //die();
    }When I print and die, I see that 'my_new_display_group' is added to $structure - so that part works, but the group is not displayed in the AdminCP.
This is the important part of the
base_custom_field_edit admin template:
		HTML:
	
	            <xf:radiorow name="display_group" value="{$field.display_group}"
                label="{{ phrase('display_location') }}">
                <xf:options source="$displayGroups" />
            </xf:radiorow>So, I need to change the value of
$displayGroups, I suppose.. 
 
		
 
 
		 Was still curious, if there's a "if display group has value" condition
 Was still curious, if there's a "if display group has value" condition 

 
 
		 
 
		 
 
		