We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38237
    • 83 Posts
    Is there an easy way to hook to an event or something similar, to detect user profile page load in manager?

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

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You could use a plugin and the OnUserFormPrerender or the OnUserFormRender event.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 3749
        • 24,544 Posts
        You might look ClassExtender, which will let you easily customize that page and save any extra fields to a custom table in the DB. It also provides an addition to the UpdateProfile snippet (part of the Login package) that lets users update the Profile and the custom fields in the front end, which is generally safer. It won't show them the sudo checkbox, for example.

        Wait for the new version of ClassExtender (2.0), though. I hope to have it out in the next day or two. The upgrade path is not very smooth, so it's better if you do a clean install of 2.0.
          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
          • 38237
          • 83 Posts
          Suzan, thank you for your help, but i was searching for an easy way to detect manager's user profile page, not the user form.

          Bob, thank you for your halp, i will consider using it.

          What I did was a plugin for "OnManagerPageInit", then i was parsing the URL and accordingly do what I wanted. Just my solution sounds very ugly. So I had to ask the experts (above responders)

          Thank you again.
          • discuss.answer
            • 38237
            • 83 Posts
            My solution in case useful for others:

            - Create a plugin with event (OnManagerPageInit)

             .....
            case 'OnManagerPageInit' :
                if($scriptProperties['action'] == 'security/profile'){
                //your code here
                }
            


            NB. Might not work on MODx versions before 2.3 (appreciate of someone can confirm that as i don't have older versions anymore)