• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Custom User Fields broken into groups

Mutt

Well-known member
If you have a LOT of custom user fields, you may want them broken into more groups than personal details, contact details, & preferences.

on the edit personal details page the default grouping is as follows with horizontal bars between them.
  • the first group is status message
  • then is avatar & custom title
  • then it's gender & birth
  • then it's EVERYTHING ELSE
  • then it's about you which allows BBCode
This small template edit lets you break up EVERYTHING ELSE into groups w/ bars between them too.

first I sorted my custom user fields with everything I wanted in 1 group after one another. then I took note of the field IDs of the first field of each new grouping

for example (order - field ID)
2 - stuff_1
3 - stuff_2
4 - stuff_3
5 - differentstuff_1
6 - differentstuff_2
7 - differentstuff_3

in template custom_field_edit at the very top add the following. of course you need to edit the array to use your field IDs
Code:
<xen:if is="in_array({$field.field_id}, array('stuff_1', 'differentstuff_1'))">
</fieldset><fieldset>
</xen:if>

now the fields have breaks between each grouping. (just before the field IDs you listed in the array)

NOTE 1: if you want a field to be in the original grouping w/ location, occupation, & home page, put them at the top of the order & do NOT include it in the array.

for example (order - field ID)
1 - something
2 - stuff_1
3 - stuff_2
4 - stuff_3
5 - differentstuff_1
6 - differentstuff_2
7 - differentstuff_3

with the exact same template edit & array as above, this customer userfield order would put something right after home page & still grouped w/ location, occupation, & home page

NOTE 2: you can also include field IDs for contact details & break up all of the identities in the same way. edit is exactly the same. just add the field IDs to the same array in the template edit.

Screenshot_3.webp

in this example Education was 1 - something & Music was 2 - stuff_1
 
on the page where you edit your contact details it's also broken into groups with horizontal bars but here each group has a category title like Identities or Messaging Preferences. if you would like your groups to be separated w/ category names like this, here's different edit.

same as above, all the custom user fields are in order & you need to pick out the field IDs of the first one in each group. For each group you need to insert your version of the following code at the same location as the previous post.

in my example, at the very bottom of the contact preferences I have 3 fields that let me know if the person is willing to go on air, their real name, & their phone number. the following edit adds a bar right above the willing_to_go_on_air field but like the Identities bar, it adds a category name.

Code:
<xen:if is="{$field.field_id} == 'willing_to_go_on_air'">
<h3 class="sectionHeader">On Air Contact Information</h3>
</xen:if>

I added this right after the edit in the 1st post.

Screenshot_2.webp

NOTE 1: it's one or the other. If you insert this code for a field ID you do NOT add it to the array in the previous post. doing so will result in 2 bars

NOTE 2: you can use this to break up the Personal Details page as well. the edit is exactly the same.
 
Funny, when I really needed this, it sucked that i couldn't do it. Then I come on and here it is! :D Thanks!
 
Top Bottom