We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49635
    • 63 Posts
    Hello!

    Is there a snippet or a module to add new fields in the profile?
    Need not static ... to add the user himself could remove a field that does not need to.
    There is a standard set that can not be removed
    And there are a set of buttons to add fields through the field, added a new field
      • 46886
      • 1,154 Posts
      Hi:

      Let me provide a little info and see where this will go. Others may have more to add.

      At a basic level you can add more fields at register or using the update profile snippet. Extra user data is normally stored in JSON files. JSON is not perfect if you want to handle that data, though. The profile now has some set values (like fax number lol) and anything over that goes into additional info and the JSON file.

      Are you talking about back end or front end users?

      There is also an add-on called ClassExtender which creates new values in the user page in the back-end, but i don't know if it can handle new fields on the fly like you are talking about.
        • 49635
        • 63 Posts
        A small digression is needed is a solution ready:

        http://joxi.ru/LmGVnn7tb8Vbrl
        


        That such a result, the fields can be much It depends on the user
          • 46886
          • 1,154 Posts
          Are you talking about gathering your own user info? Do you want this data to go in the JSON file?

          Well it looks like you could just use update profile snippet, which will let your users add or change info.

          However I see two potential problems. First is, you *may* (not sure) have to use register snippet to make a new field for user data (maybe update profile can do it also), and making new fields on the fly will require some sort of custom coding, I think, but it might not be too hard.

          I get some extended fields for users on register, and here is the sample code, this will take the data and put it into the JSON file:

                  <!--Date of birth-- If you want it in the User General Information field than "date_of_birth" must be replaced with "dob"-->
          <li><label for="date_of_birth">Date of Birth:</label>
                      <span class="error">[[!+reg.error.date_of_birth]]</span>
                  </label>
                  <input type="text" name="date_of_birth" id="dob" value="[[!+date_of_birth:date=`%Y-%m-%d`]]" /></li>


          To be clear, by giving this the name="date_of_birth" it becomes an extended field, if it was name="dob" it would go into the general information tab.

          HTH
            • 28042 ☆ A M B ☆
            • 24,524 Posts
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org