We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41844
    • 12 Posts
    Hi,

    I just installed MODX 2.3 and I think it is a very good upgrade.

    But then it seemed that a lot of what I had learned about developing extras wasn't working anymore. I found this page (http://rtfm.modx.com/revolution/2.x/developing-in-modx/advanced-development/custom-manager-pages/custom-manager-pages-in-2.3) and it helped me understand some of the changes in regards to loading the extra from a theme folder. But beyond that, I am lost.

    So my question is: Are there any good examples on GitHub for example, showing how to make an extra with Custom Manager Pages and all the other goodness?

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

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      As far as I can tell, the only major change is in how the menus work. You simply add a new menu item, with the name of your connector such as 'index' for an index.class.php file. MODX will automatically generate the path from your namespace, such as core/components/mycmp/index.class.php
        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
        • 41844
        • 12 Posts
        Hmmm...

        Ok. Good to know it works like before smiley

        Now, my problem is that when I've got my namespace (mycmp) and my action (index), in the Menus manager, it only wants to load components/mycmp/controllers/default/index.class.php! This is where the tutorial in my first post leads to. I can't seem to get it to load components/mycmp/index.class.php.

        I see that the Doodles extra, for example, only has an ID in the Menu action field, relating to a row in the modx_actions table. Do I have to create an action there?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
            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
            • 41844
            • 12 Posts
            Quote from: sottwell at Aug 25, 2014, 01:20 PM
            http://rtfm.modx.com/revolution/2.x/developing-in-modx/advanced-development/custom-manager-pages/custom-manager-pages-in-2.3

            Yes, this is the tutorial I was speaking of! Now, using this method, it seems to remove the need for the modx_actions table – and the url is friendlier. But, since the tutorial stops before it really tackles CMP's, with all the MODexts and processors, I was wondering if anyone knows how I should continue? Is there a part 2 on its way or does somebody have a working example?
            • discuss.answer
              • 3749
              • 24,544 Posts
                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
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                The rest of the other tutorials is the same. It's only the Actions and Menu that has changed.
                  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
                  • 41844
                  • 12 Posts
                  Quote from: BobRay at Aug 25, 2014, 11:05 PM
                  See if this helps: http://bobsguides.com/blog.html/2014/03/28/modx-2.2-cmps-an-anatomy-lesson/

                  I was able to use the initialize()-function from the index.class.php file in the example, in my /controllers/default/home.class.php file. Now the class for my extra is loaded into the controller and from there I believe it will be quite straight forward, like before smiley

                  Thanks!
                    • 36926
                    • 701 Posts
                    Quote from: havardvidme at Aug 26, 2014, 06:29 AM

                    I was able to use the initialize()-function from the index.class.php file in the example, in my /controllers/default/home.class.php file. Now the class for my extra is loaded into the controller and from there I believe it will be quite straight forward, like before smiley

                    @havardvidme do you have anything you can share as i'm trying to get the doodles example working within 2.3 but no luck.
                      • 41844
                      • 12 Posts
                      I will of course try to share what I found out, @bennyb – sorry I haven't gotten around to it before smiley

                      My problem, when trying to make an extra in 2.3 was the fact that I was unable to load the modExtraManagerController properly. Prior to 2.3 I would just make a "general" controller in the root folder of the extra (core/components/test/index.class.php). Then, in the controllers folder, you would add your "page specific" controller files (i.e home.class.php). The latter seemed to automatically include the former.

                      I could not make this work in 2.3, and in the end I ended up skipping the index.class.php altogether. Instead I made a default folder inside the controllers folder, and I then put the "page specific" controller files there (i.e home.class.php). In each of these files I extended the class like this: class TestHomeManagerController extends modExtraManagerController and class TestEditManagerController extends modExtraManagerController.

                      There may be a simple way of making a general class file that can be included in the specific class files, but I haven't gotten that far yet wink

                      Hope this was helpful! Good luck smiley