We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36926
    • 701 Posts
    I have some CMPs that I want to work within 2.3 but all they do is load a white page. Most of these are based of the doodles tutorial so I thought I'd see if the copy of doodles i have works, but this is also giving me the same blank page.

    What are the major differences from creating doodles on 2.3 compared to 2.2.

    Am I right in thinking you no longer need:
    core/components/doodles/index.class.php
    <?php
    /**
     * @package doodles
     * @subpackage controllers
     */
    require_once dirname(__FILE__) . '/model/doodles/doodles.class.php';
    abstract class DoodlesManagerController extends modExtraManagerController {
        /** @var Doodles $doodles */
        public $doodles;
        public function initialize() {
            $this->doodles = new Doodles($this->modx);
    
            $this->addCss($this->doodles->config['cssUrl'].'mgr.css');
            $this->addJavascript($this->doodles->config['jsUrl'].'mgr/doodles.js');
            $this->addHtml('<script type="text/javascript">
            Ext.onReady(function() {
                Doodles.config = '.$this->modx->toJSON($this->doodles->config).';
            });
            </script>');
            return parent::initialize();
        }
        public function getLanguageTopics() {
            return array('doodles:default');
        }
        public function checkPermissions() { return true;}
    }
    /**
     * @package doodles
     * @subpackage controllers
     */
    class IndexManagerController extends DoodlesManagerController {
        public static function getDefaultController() { return 'home'; }
    }
    


    And then just point the Menu direct to:
    core/components/doodles/controllers/home.class.php

    If so what happens all the stuff happening within the initialize function?

      • 44301
      • 1 Posts
      Same problem here. Would like to know how I can get this fixed.
        • 36926
        • 701 Posts
        Hey mpohimann,

        Thought I'd actually posted back here a solution, but guess i forgot.

        Basically the easiest way is to point the menu to the home.class.php, so just put home instead of index and then add a require once for the index file inside of home.class.php. So you'd have something like this at the start of the class.

        require_once dirname(__FILE__) . '/../index.class.php';
        class DoodlesHomeManagerController extends DoodlesManagerController {
        ....
        }
        



        For more details see Mark Hamstra's response here:
        https://forums.modx.com/thread/92833/custom-manager-pages-in-2-3?page=2#dis-post-513595
          • 44301
          • 1 Posts
          Sorry, didn't see the other post.

          Your solution works perfect. Thanks.