We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49481
    • 32 Posts
    This obviously hasn't been updated for Modx 2.3 but I got part 1 done.
    I'm in part 2 and trying to do the equivalent of adding the CMP menu item to the navbar.

    As far as I'm aware, Modx 2.3 needs to use the namespace and action name, rather than just an action id number.

    I've added "doodles" as the namespace and "index" as the action.
    Unfortunately when trying to access the CMP I just get a blank white page. No manager at all.

    Everything I've done is set up the exact same way as part 1 in the tutorial.
    My controller is named index.class.php and is located in /core/components/doodles/

    Can anyone shed some light on this?

    EDIT: If I manually give it an action id number via the database and make the namespace core it works. (the old way)

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

    [ed. note: reginald last edited this post 11 years, 7 months ago.]
      • 3749
      • 24,544 Posts
      What's the namespace path and where is the index.php file?

      Try putting this at the top of the index.php file:

      return "Hello";
        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
        • 49481
        • 32 Posts
        Hi Bob,

        I don't have an index.php file. The tutorial had me create index.class.php. (Will MODX differentiate between the two?)
        Regardless, I tried creating an index.php file at the same location that returned the hello string but it still didn't work unfortunately.

        The URL that doesn't work when attempting to view the CMP is: http://localhost/modxsdk/manager/?a=index&namespace=doodles
        The URL that does work when attempting to view the CMP is: http://localhost/modxsdk/manager/?a=6

        My namespace core path: /var/www/html/doodles/core/components/doodles/
        My namespace assets path: /var/www/html/doodles/assets/components/doodles/




        EDIT: I tried changing the URL slightly http://localhost/modxsdk/manager/?a=fakefile&namespace=doodles
        to have ?a=fakefile instead of just ?a=index

        When I do this the manager actually loads and presents me with the error message
        Could not find action file at: /var/www/html/doodles/core/components/doodles/fakefile.php

        So it must be finding the file when it just returns a blank page.. because it reports it can't find the action file when it's really not there.
        [ed. note: reginald last edited this post 11 years, 7 months ago.]
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Check your server's PHP error log. Usually a blank page means a fatal PHP error that stops MODX from working at all.
            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
            If you look at the network tab in Chrome Dev. tools, you may be able to see the PHP error message.

            http://bobsguides.com/blog.html/2013/05/22/debugging-cmps-a-horror-story/
              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
              • 49481
              • 32 Posts
              Firebug is showing a 500 Internal Server Error and my server's PHP error log shows the following:

              [Thu Feb 05 19:13:35.070229 2015] [:error] [pid 4761] [client 127.0.0.1:39177] PHP Fatal error:  Class 'DoodlesIndexManagerController' not found in /var/www/html/modxsdk/core/model/modx/modmanagerresponse.class.php on line 185, referer: http://localhost/modxsdk/manager/



              I'm not sure where the "DoodlesIndexManagerController" is coming from because in my index.class.php file I've just got DoodlesManagerController extending modExtraManagerController .....

                • 29661
                • 116 Posts
                Here's tutorial for CMPs for 2.3 http://rtfm.modx.com/revolution/2.x/developing-in-modx/advanced-development/custom-manager-pages/custom-manager-pages-in-2.3

                You can take the part about namespaces/actions/controllers and use it with the Doodles tutorial
                  --
                  John
                  @theboxer
                  • 49481
                  • 32 Posts
                  Hi Boxer. Yes, as far as I can tell that's the way I set it up. (Except my controller is named index instead of welcome).

                  The contents of my controller file index.class.php are exactly the same as the Doodles tutorial.
                    • 49481
                    • 32 Posts
                    I found this thread which seems to have the same problem:

                    https://forums.modx.com/thread/?thread=92833&page=2

                    I'll try extending the controller directly when I get a chance and report back.
                      • 49481
                      • 32 Posts
                      If I rename index.class.php to just index.php it stops complaining about not finding the DoodlesIndexManagerController and loads the manager.
                      The CMP itself just shows a "1" however.