Hi guys, I’m getting my hands dirty (once again) with the building process of an extra, for most of the process I’ve been following the guide here and managed to generate the model, create most of my classes, and solved a couple “file not found” issues related to paths.
Today I just go to this amazing post and managed to solve some of my doubts, still, the Doodles extra isn’t working. The main pieces I have are the init class which is referenced from the menu:
require_once dirname(MODX_BASE_PATH) . ‘/html/doodlesMine/core/components/doodles/model/doodles/doodles.class.php’;
class MyDoodlesInitManagerController extends modExtraManagerController {
/** @var Doodles $doodles */
public $doodles;
public function initialize() {
$this->doodles = new Doodles($this->modx);
$this->modx->log(modX::LOG_LEVEL_ERROR, 'Will initializae: '. ($this->doodles->config['jsUrl'].'mgr/widgets/doodles.grid.js'));
$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;}
public function process(array $scriptProperties = array()) {}
public function getPageTitle() { return $this->modx->lexicon('doodles'); }
public function loadCustomCssJs() {
$this->addJavascript($this->doodles->config['jsUrl'].'mgr/widgets/doodles.grid.js');
$this->addJavascript($this->doodles->config['jsUrl'].'mgr/widgets/home.panel.js');
$this->addLastJavascript($this->doodles->config['jsUrl'].'mgr/sections/index.js');
}
public function getTemplateFile() {
return $this->doodles->config['templatesPath'].'home.tpl';
}}
and my template
<div id="doodles-panel-home-div"></div>
<h2>Pegueloooo!</h2>
I also have al the JS files on the right locations, and the paths configured inside the Doodles class.
I also tried just downloading the doodles repo and just creating the namespaces and menu items, but sill im just getting and empy screen with the ‘Pegueloooo’ message but nothing else.
Also came across this but could not find the “original” repo.
The generate schema process worked as expected and the table is correctly generated inside mysql
Any ideas of what could be wrong? I’m trying to understand the basic elements of an extra before digging on the VueJS done by @aredfhealy