We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8489
    • 90 Posts
    I have set up some customfields in modx_web_user_attributes_extended and now I need them to be placed inside the manager for editing and saving.

    What is the best way to do this, and are there some online examples?

    Could this do the trick?
    http://wiki.modxcms.com/index.php/DB_query_and_Placeholders

    Thanks,
    Edski
      • 4310
      • 2,310 Posts
      Depends on how you want the info displayed.
      I have / you could hack these core files to add your fields/replacing existing fields to the existing Web User Management :
      manager/actions/web_user_management.static.php
      manager/actions/mutate_web_user.dynamic.php
      manager/processors/save_web_user.processor.php

      Downside is no more easy upgrades, upside is seamless integration.
      Equally you could use the example given as a starting point and create a Module or private pages etc.
      I’ve attached a couple of screen grabs of method one.
        • 8489
        • 90 Posts
        Hello Bunk58,

        Thanks for your information.

        I don’t want to hack the core files, but it looks like a easy solution!

        Could this possible work without hacking the core files?
        A plugin with OnWUsrFormPrerender with the code from http://wiki.modxcms.com/index.php/DB_query_and_Placeholders,
        and a template for the input fields with place holders?


        Thanks,
        Edski
          • 4310
          • 2,310 Posts
          If you just want to view them then maybe a module pulling through all the fields into a grid ?
          I don’t know about the plugin idea, maybe someone else will chime in.
            • 8489
            • 90 Posts
            I have set up a Plugin with the code from http://wiki.modxcms.com/index.php/DB_query_and_Placeholders
            I checked OnWUsrFormPrerender and I made a chunk with only [+bedrijfsnaam+] and [+kvknummer+] to see if something will show up in the manager.

            Now I get this error:

            WebuserCustomManagerFields - OnWUsrFormPrerender
            An error occurred while loading. Please see the event log for more information.

            Parse error: syntax error, unexpected ’<’ in /home/mysite.nl/public_html/manager/includes/document.parser.class.inc.php(745) : eval()’d code on line 1

            And I didn’t change anything in the core code
              • 4310
              • 2,310 Posts
              Plugins, unlike Snippets, don’t want the
               <?php ... ?>
              tags, is that causing the error?
                • 8489
                • 90 Posts
                Quote from: bunk58 at Apr 30, 2009, 02:46 AM

                If you just want to view them then maybe a module pulling through all the fields into a grid ?
                I don’t know about the plugin idea, maybe someone else will chime in.

                I need it as input fields in the manager under the webuser so I can change the data from modx_web_user_attributes_extended.
                Yeah would be great If there is a solid solution without hacking the core code.
                  • 8489
                  • 90 Posts
                  Quote from: bunk58 at Apr 30, 2009, 04:19 AM

                  Plugins, unlike Snippets, don’t want the
                   <?php ... ?>
                  tags, is that causing the error?

                  If I remove then nothing is happening in the manager under webusers, but the error is then gone
                    • 8489
                    • 90 Posts
                    In the chunk I only have put [+bedrijfsnaam+] and [+kvknummer+] just to see if something will show up in the manager, is this this a good way to see if it is pulling the data from the modx_web_user_attributes_extended and show it in the manager?
                      • 4310
                      • 2,310 Posts
                      I don’t think your approach will work.
                      Pulling the data from the DB is one step, getting it to display and be editable via the Web User Management tools in the Manager requires a lot more work sad