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

    For Modx Revolution I need to create some custom manager interface for my needs and i'm wondering what is the best JS framework to use for various effects in backend ? I know that modx use ExtJS and I plan to use it in the future but it has a long learning curve and I need quicker solution for now. Can I use jquery or maybe mootools is better option ? .. or something else ?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      No, you don't need to use ExtJS. As it says in the CMP tutorial,
      ...you could just output forms and code here, and do all your stuff in this index.php file. You don't have to use ExtJS, or any of the other functions.

      So once you get your CMP loading your base index.php controller, you can do anything you want in that file.

      It has been suggested that you should load your own Javascript libraries using the regClientStartupScript() API functions, the same as you would with a snippet.
        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
        • 4172
        • 5,888 Posts
        Depending on what you want to do with the CMP, may be, using MIGXdb can help to create it, without knowing much ExtJS

        But you can use any framework for a complete custom - made - CMP or create Front-pages, where only mgr-users have access to.
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 3749
          • 24,544 Posts
          JQuery will work fine. I've also created CMPs in plain HTML with just a regular web form.
            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
            • 29796
            • 91 Posts
            Thanx for the info .. i have two more questions about development.

            1. I checked official guide "developing-an-extra-in-modx-revolution" where you create that doodles "addon". There is folder and files structure explained... but I don't want to creat it from scratch for each addon, so I need a blank structure with all necessary files which are allways needed.

            So my first question is what to use for a good start...

            - Example from tutorial https://github.com/splittingred/Doodles ?
            - Maybe this https://github.com/modxcms/ThemePackagerComponent
            - Or probably is the best to use http://modx.com/extras/package/mycomponent to create a blank project ?

            or is there a fourth option ?

            2. I'd like to use default modx styling (tabs, lists, buttons,...) Is there any reference of what styles have on my disposal ? .. i checked few ExtJs examples where a lot of classes are used and is confusing to get the right styling out...

            Thanx
              • 3749
              • 24,544 Posts
              1. I use MyComponent for everything.

              2. There may be documentation on extJS styling for MODX, but I'm not aware of any.

                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
                • 20413
                • 2,877 Posts
                  @hawproductions | http://mrhaw.com/

                  Infograph: MODX Advanced Install in 7 steps:
                  http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                  Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                  http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  I'll second mrhaw's recommendation. It take a little focusing to get a grip on the JSON syntax, but once you do it is actually pretty simple.

                    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
                    • 29796
                    • 91 Posts
                    I installed MyComponent and play with it a little. In short .. is great ... but I have some problems with custom DB tables.

                    For test I used schema from "doodles" example with different name. I successfuly created build.schema.php file to create DB table, but I didn't managed to insert it into myComponent.

                    I did the following .. for package name I used "uros":

                    1. under assets/mycomponents/uros/core/components/uros/model/schema I added uros.mysql.schema.xml
                    2. under assets/mycomponents/uros/_build/resolvers I updated uros.resolver.php and inserted following code inside case xPDOTransport::ACTION_INSTALL:

                    $modx =& $object->xpdo;
                    $modelPath = $modx->getOption('core_path').'components/uros/'.'model/';
                    $modx->addPackage('uros',$modelPath);
                    $manager = $modx->getManager();
                    $manager->createObjectContainer('uros');
                    


                    3. choosed bootstrap in MyComponent Actions ..
                    4. choosed build in MyComponent Actions ..
                    5. copied created file uros-1.0.0-beta1.transport.zip under other modx installation and try to insall it

                    before I inserted that schema installation went fine .. now when i install it .. installation window pops up .. but doesn't give me any info and freeze there .. i need to refresh the manager to continue .. anyway package is installed but custom DB is not created

                    So my question is .. what I did wrong or what is the right way ? And another question .. why MyComponent creates me a file uros.resolver.php and in doodle example is resolve.tables.php instead of doodles.resolver.php? Do all files run inside resolvers folder?

                    Thanx for help
                      • 3749
                      • 24,544 Posts
                      You have to make sure that resolver runs after the file resolver that copies the schema file, though I think that should happen by default unless you're modified the build.transport.php file.

                      It sounds like you're getting a blank console on install. If you are using Chrome (and maybe other browsers), you need to reload the Manager page after searching locally for packages but before running the install -- clearing the site cache won't help.

                      MyComponent will create any resolvers you specify in the 'resolvers' section of the config file, though componentName.resolver.php will be the default one. All the resolvers in the resolvers folder will run.

                      I don't see anything wrong with the way you're doing things. I think it's how I would do it.

                      FYI, it's usually a good practice to run ImportObjects and ExportObjects after making changes to the files and before running the build. That will update the special-case resolvers and the config file in the project directory.

                      Just a suggestion -- I would add something like this after line 2 of your code above:

                      if (! is_dir($modelPath)) {
                          $modx->log(modX::LOG_LEVEL_ERROR, 'Files not in place');
                      }
                        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