We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    I am using pdoUsers to create a members list - it works great pulling the basic user fields (e.g. [[+username]], [[+phone]] etc), but it can't seen to pull in any custom fields I have created - e.g. [[+favcolour]] - it will not fetch them...

    Is it possible to fetch this data? It is in the Database as when I inspect the user within the Manage Users section of the CMS it's all their in the extended fields - and also fetched when I use [[+profile]] on the members own view profile page... It seems like pdoUsers does not pull the data though???

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

      • 42046
      • 436 Posts
      You will need to extend modUser in order to search easily in custom fields.

      http://modx.com/extras/package/classextender
      http://bobsguides.com/classextender-class.html
        • 8168
        • 1,118 Posts
        Quote from: absent42 at Oct 17, 2014, 09:37 AM
        You will need to extend modUser in order to search easily in custom fields.

        http://modx.com/extras/package/classextender
        http://bobsguides.com/classextender-class.html

        Dan - will this work with the pdoTools' pdoUser addon I am using?
          • 42046
          • 436 Posts
          Yes. Extending modUser creates new database fields which act just like the standard ones.
            • 8168
            • 1,118 Posts
            OK thanks, any chance of some guidance on how to get things working using this class extender? I have the addon installed, I assume there must be a specific tag/syntax to call the none-standard user fields data now?
              • 8168
              • 1,118 Posts
              Looks like using this approach means the Extended Fields I have already created will no longer be needed? Does this replace use of the Extended Fields then?
              • discuss.answer
                • 42046
                • 436 Posts
                It's better than using standard extended fields and [[+extended.keyname]]

                Bob's tutorial linked above is pretty comprehensive.
                  • 8168
                  • 1,118 Posts
                  OK thanks - was hoping to find a solution without having to remake all the custom fields truth be told... If this is the better way than using the base Extended fields then I will give it a go.
                    • 8168
                    • 1,118 Posts
                    +extended.newfieldname

                    THANKS! that works smiley no need to re-create anything... that's what I was looking for smiley