We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38783
    • 571 Posts
    I would like to use ClassExtender to create additional user fields.

    I have this working OK for fields that are varchar and presented in Security / Manage Users / Update User part of the MODX Manager as single line entries.

    However, I would like to create some fields as dbtype="mediumtext" (or just 'text') and present them as textareas in the Security / Manage Users / Update User part of the MODX Manager. (Like the existing user 'comment' field).

    The MyExtUserSchema code works OK to create the correct entry in the ext_user_data table in my database.

    But I have not had any luck with presenting this as a textarea in the manager. None of my efforts are worth recording here as they have achieved nothing.

    Can anyone advise how my MyExtraUserFields should be written to get this to happen?

    I am also interested in presenting some fields with form select option values, but am similarly stuck.

    Any advice would be gratefully received!


    MyExtUserSchema
    <field key="pdtiInvolvement" dbtype="mediumtext" phptype="string" null="true"/>



    MyExtraUserFields

    <div class="x-form-item x-tab-item">
        <label class="x-form-item-label" style="width:auto; font-weight:bold; float:none; font-size:12px">PDTI Involvement</label>
    
        <div class="x-form-item x-tab-item">
            <input type="text" name="pdtiInvolvement" value="[[+pdtiInvolvement]]" class="x-form-text x-form-field"
                    onClick="Ext.getCmp('modx-panel-user').markDirty();"/>
        </div>
    </div>



    This question has been answered by BobRay. See the first response.

      If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

      email: [email protected] | website: https://andytough.com
    • discuss.answer
      • 3749
      • 24,544 Posts
      Try something like this in the chunk:

      <textarea name="pdtiInvolvement" value="[[+pdtiInvolvement]]" class="x-form-text x-form-field" rows="10" cols="70" onClick="Ext.getCmp('modx-panel-user').markDirty();">[[+pdtiInvolvement]]</textarea>


      You might have to change the class. Inspect the Create/Edit Resource page and see what the class is for the introtext or content fields.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 38783
        • 571 Posts
        Quote from: BobRay at Dec 29, 2014, 04:42 PM
        Try something like this in the chunk:

        <textarea name="pdtiInvolvement" value="[[+pdtiInvolvement]]" class="x-form-text x-form-field" rows="10" cols="70" onclick="Ext.getCmp('modx-panel-user').markDirty();">[[+pdtiInvolvement]]</textarea>


        You might have to change the class. Inspect the Create/Edit Resource page and see what the class is for the introtext or content fields.

        Hello Bob, Thank you very much for getting back to me about this. I will give it a try and let you know how I get on. Andy
          If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

          email: [email protected] | website: https://andytough.com
          • 38783
          • 571 Posts
          Hello Bob

          It worked perfectly! Thank you.

          As you suspected I just had to change one class name from text to textarea. See below.

          <div class="x-form-item x-tab-item">
              <label class="x-form-item-label" style="width:auto; font-weight:bold; float:none; font-size:12px">PDTI Involvement</label>
          
              <div class="x-form-item x-tab-item"><textarea name="pdtiInvolvement" value="[[+pdtiInvolvement]]" class="x-form-textarea x-form-field" rows="10" cols="70" onclick="Ext.getCmp('modx-panel-user').markDirty();">[[+pdtiInvolvement]]</textarea>
              </div>
          </div>
            If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

            email: [email protected] | website: https://andytough.com
            • 3749
            • 24,544 Posts
            I'm glad it worked for you. Thanks for reporting back on the class name smiley
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 46886
              • 1,154 Posts
              And thanks for the working code too