We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33968
    • 863 Posts
    I would like to have a custom manager page open on manager login, rather than the default Welcome page.

    Is this possible?
      • 26903
      • 1,336 Posts
      You could try redirecting from the OnManagerLogin event, the component menu is just an action list like ../manager/index.php?a=73 or whatever the cmp is your trying to invoke.
        Use MODx, or the cat gets it!
        • 33968
        • 863 Posts
        Great idea, that worked smiley

        Here’s the plugin code:
        <?php
        if ($modx->event->name == 'OnManagerLogin') {
            $path = $modx->getOption('base_url',null,MODX_BASE_URL);
            $modx->sendRedirect($path.'manager/?a=69');
        }
        

        OnManagerLogin checked in plugin properties.

        Change ’69’ to id of your CMP.
          • 14668
          • 11 Posts
          Nice. This is a great option. This will work for me to set a "manager instructions" page as the welcome screen for an older client. Thanks for sharing the plugin lucas!
            • 33968
            • 863 Posts
            No problem smiley It’s not perfect though - clicking ’Home’ on the manager menu will still take you to the old welcome page.

            I think Revo 2.2 will allow us to customise that page however.
              • 14668
              • 11 Posts
              I’ve seen people say that you can’t customize the manager welcome page, but there’s "welcome.tpl" in manager/templates/default, and I found that clearing out all the html except the system check allows me to add in my own (html) and make a custom manager welcome screen.

              Edit: I don’t know how to insert chunks from MODx or anything like that into welcome.tpl, it’s just handy to make my own page with static content for the client to see.
              • Quote from: okyanet at Jul 01, 2011, 06:29 AM
                Great idea, that worked smiley

                Here's the plugin code:
                <!--?php
                if ($modx--->event->name == 'OnManagerLogin') {
                    $path = $modx->getOption('base_url',null,MODX_BASE_URL);
                    $modx->sendRedirect($path.'manager/?a=69');
                }
                

                OnManagerLogin checked in plugin properties.

                Change '69' to id of your CMP.

                I don't manage to make it work with MODX Revolution 2.5.0-pl.
                It seems that OnManagerLogin do not work at all.
                Am I the only one ?

                Is it related to this ?
                https://github.com/modxcms/revolution/issues/11848

                I've alos tried this :

                $e = $modx->event;
                switch( $e->name ) {
                case 'OnManagerLogin':
                $modx->sendRedirect('http://modx.com',array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));
                }
                [ed. note: hartus last edited this post 7 years, 1 month ago.]
                  • 3749
                  • 24,544 Posts
                  In later versions or MODX, the action no longer has an ID. So editing a resource with the ID of 12, for example, would be:

                  yoursite.com/manager/?a=resource/update&id=12


                  "resource/update" is the action.

                  I'm pretty sure that when MODX sees that, it loads the class file manager/controllers/resource/update and calls its process() method.

                  One way to do one of your own, would be to put a controller class or php file in manager/controllers and create a tpl for it. Then set the welcome_action System Setting to the name of your controller.

                  Another way to go: The welcome controller loads the user's default dashboard. So you could create a custom dashboard, with or without custom widget(s) and make sure the appropriate User Groups had that set as their dashboard. The controller gives precedence to the User's Primary User group.

                  The second method would be much easier.
                    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