We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    Take, for instance, the photo field.

    How do I edit the table to have a text for a default avatar (the text I would want would be default.png, btw.)? (This is for a User program I’m starting on my website, btw.)
      My Snippets
      -> PopUpChunk v1.0
      • 10487 MODX Staff
      • 1,535 Posts
      You’ll need to go into PHPMyAdmin (or equivalent) and set a default value for that field. It’s not possible to do it through the MODx Manager.
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
        • 3749
        • 24,544 Posts
        My SQL is pretty rusty, but I think you might be able to do something like the following using the db_api to execute the sql:

        alter table web_user_attributes modify photo set default ’’default.png"

        It would be much safer, though, to do it in PhpMyAdmin, and probably easier as well unless you have a lot of sites to do it in.

        You probably know how, but let me run it down for future readers:

        1. Launch phpMyAdmin, usually in the ISP’s control panel -- click on in MySQL databases and look for the obscure phpMyAdmin link near the very bottom of the page.

        2. Select the MODx database.

        3. Select the web_user_attributes table.

        4. Find the "photo" field and click on the pencil to modify it.

        5. Fill in your desired value under "default"

        6. Click save.


        Cheers,

        Bob



          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