We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46886
    • 1,154 Posts
    Ok I am implementing this now, and want to walk through it quickly.

    The big questions are: how to display and get input from users (and the answer should be [[!ExtUserUpdateProfile]] at the very top before [[!UpdateProfile]] and also call the chunk [[$ExtraUserFields]] in the page where users will input the data to provide the form buttons to use. This chunk seems to be more for displaying the buttons and text-spaces for inside the manager, so I could cut out the code guts of it, but I am only worried about the page for my users to input data now.

    So I decided to keep things simple. Only two values, one text one boolean. No ordering or grouping or anything, so its not a clean and perfect solution. Here are my keys for the db:

    <field key="ce_current_location" dbtype="varchar" precision="50" phptype="string" null="true"/>
    <field key="ce_interest1" dbtype="tinyint" precision="1" phptype="boolean" default="0" null="true"/>


    And my code for the update page:

            <!--Start of ClassExtender Data-->
            <!--Current Location-->
            <label for="ce_current_location">Current Location: 
                <span class="error">[[+reg.error.required]]</span>
            </label>
            <input type="text" name="ce_current_location" id="ce_current_location" value="[[+ce_current_location]]" />
    ...
            <label for="ce_interest1">Is interest1 interesting?
                <span class="error">[[+reg.error.check_box_goal]]</span>
            </label>
            <input type="checkbox" name="ce_interest1" value="1" [[!+check_box:FormItIsChecked=`1`]] onClick="Ext.getCmp('modx-panel-user').markDirty();" />


    Hopefully this will have me good to go. But I don't see why I have to have this onClick...but it must save the 'dirty' data? Not sure but will find out soon, I think I will leave it out at first. It might be this above issue of whether we are considering data viewable and changeable from the manager, or not.

    And it doesn't matter because as long as I set up the db right, I can focus on getting the data in there somehow.

    Edit: Oh, I can't have null=true and also default=0, so I will go with default over null
    [ed. note: nuan88 last edited this post 11 years, 6 months ago.]
      • 46886
      • 1,154 Posts
      Ok the first step seems to have gone well. I copped out and just used text strings for every value, its just easier and less risky.

      My modified list of values, I included some extra values just in case I need them later:

      <field key="ce_location" dbtype="varchar" precision="70" phptype="string" null="true"/>
      <field key="ce_gender" dbtype="varchar" precision="70" phptype="string" null="true"/>
      <field key="ce_value1" dbtype="varchar" precision="70" phptype="string" null="true"/>

      When I first clicked on the resource, it had a default template which caused problems, but I just saved it with a new template. After I clicked submit, it sent me to a weird address but seemed to error out or the page didn't exist.
      https://www.mywebsite.com/class-extender/class-extender/extend-moduser.html

      But, after I activated the plugin, the values do indeed appear in the manager! Now to see if they can be inputted by users!