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

Adding new display groups to the userfields

Discussion in 'XenForo Development Discussions' started by xf_phantom, May 19, 2013.

  1. xf_phantom

    xf_phantom Well-Known Member

    How to do this?

    i've extended the userfield model and datawriter, added it to the enum field in the database, but what's the best way to put this into an addon?
    e.g. i can't just use this query

    ALTER TABLE  `xf_user_field` CHANGE  `display_group`  `display_group` ENUM
    (  'personal',  'contact',  'preferences',  'test1', 'test2' )
    CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT  'personal';
    because it would add test1 and test2 but remove e.g. all other custom enum values.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Hmm, an enumerated type like that isn't really made to be extended. It's probably better to create a new field for your custom categories, and implement them separately from the default categories.

    Ideally the devs should create a proper category system for user fields.
    erich37 likes this.
  3. xf_phantom

    xf_phantom Well-Known Member

    Sorry, not sure how you mean this. I can't add a new userfield with a new display location (display_group) without changing the db structure.

Share This Page