We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11927
    • 105 Posts
    My custom manager pages don’t have scrollbars. Is this error fixed?

    According to this bug report it is.
    http://bugs.modx.com/issues/4656

    But according to another one, it isn’t.
    http://bugs.modx.com/issues/4940

    I’ve read this topic, but don’t understand what they are talking about.
    http://modxcms.com/forums/index.php/topic,65123.0.html

    Am I supposed to do some ExtJS stuff in my custom manager page?


    I have my CMP as part of the Components menu. I looked at the place that Quip loads into the html and compared it to where my CMP loads into the html. They load into the html in different places.
    - see below -

    Quip
    <div id="ext-gen45">
    <div id="ext-gen46">
    <div id="the-quip-div">Quip stuff here.</div>
    </div>
    </div>


    My CMP
    <div id="my-cmp-div">My CMP stuff here.</div>
    
    <div id="ext-gen45">
    <div id="ext-gen46">
    </div>
    </div>


    I’m not using echo any where in my php.
      You may or may not want to use the code I write. It&#39;s probably all against the syntax rules of php and MODx. smiley

      Carpet Cleaning
      • 4172
      • 5,888 Posts
      If you’re making simple CMPs without any extjs, you can try this method to create them just by creating snippets in a given category.

      Scrolling should work with this, also when echoing your output.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 11927
        • 105 Posts
        Thanks! Got it working.

        I created a js file called make-box.js and put it in /assets/components/my-cmp/js/ .

        Then I added these two lines of code to the end of my CMP. It doesn’t organize the CMPs like Bruno17’s php code does, but I just wanted the custom manager pages to scroll. Make sure your CMP has a wrapper div that has the id of my-cmp-div.

        <?php
        	$jsUrl = $modx->getOption('assets_url') . 'components/my-cmp/' . 'js/';
        	$modx->regClientStartupScript($jsUrl.'make-box.js');




        make-box.js code (the only part I changed from Bruno17’s is the id of the div to my-cmp-div):

         var QuickCMP = function(config) {
            config = config || {};
            QuickCMP.superclass.constructor.call(this,config);
        };
        Ext.extend(QuickCMP,Ext.Component,{
            page:{},window:{},grid:{},tree:{},panel:{},combo:{},config: {}
        });
        Ext.reg('quickcmp',QuickCMP);
        
        var QuickCMP = new QuickCMP();
        
        QuickCMP.page.Object = function(config) {
            config = config || {};
            Ext.applyIf(config,{
        		components: [{
                    xtype: 'box'
                    ,id: 'quickcmp-box'
                }]
        
            }); 
            QuickCMP.page.Object.superclass.constructor.call(this,config);
        };
        Ext.extend(QuickCMP.page.Object,MODx.Component);
        Ext.reg('quickcmp-page-home',QuickCMP.page.Object);
        
        Ext.onReady(function() {
        
            var qcmp = MODx.load({ 
        		xtype: "quickcmp-page-home"
            });    
        	
            var panel =Ext.getCmp("quickcmp-box");
            var el = Ext.get("my-cmp-div");
            el.appendTo(panel.el);
            
        });
        
        
          You may or may not want to use the code I write. It&#39;s probably all against the syntax rules of php and MODx. smiley

          Carpet Cleaning
          • 11927
          • 105 Posts
          Having a brain malfunction. What is the Revo equivalent of insideManager()?
            You may or may not want to use the code I write. It&#39;s probably all against the syntax rules of php and MODx. smiley

            Carpet Cleaning
            • 28215
            • 4,149 Posts
            Quote from: heavensbest at Jun 27, 2011, 10:30 AM

            Having a brain malfunction. What is the Revo equivalent of insideManager()?

            if ($modx->context->get('key') == 'mgr') {
            /* in mgr */
            }
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 11927
              • 105 Posts
              Yep, that’s it. Thanks.
                You may or may not want to use the code I write. It&#39;s probably all against the syntax rules of php and MODx. smiley

                Carpet Cleaning
                • 4172
                • 5,888 Posts
                Quote from: heavensbest at Jun 27, 2011, 09:53 AM

                Thanks! Got it working.

                I created a js file called make-box.js and put it in /assets/components/my-cmp/js/ .

                Then I added these two lines of code to the end of my CMP. It doesn’t organize the CMPs like Bruno17’s php code does, but I just wanted the custom manager pages to scroll. Make sure your CMP has a wrapper div that has the id of my-cmp-div.

                <?php
                	$jsUrl = $modx->getOption('assets_url') . 'components/my-cmp/' . 'js/';
                	$modx->regClientStartupScript($jsUrl.'make-box.js');




                make-box.js code (the only part I changed from Bruno17’s is the id of the div to my-cmp-div):

                 var QuickCMP = function(config) {
                    config = config || {};
                    QuickCMP.superclass.constructor.call(this,config);
                };
                Ext.extend(QuickCMP,Ext.Component,{
                    page:{},window:{},grid:{},tree:{},panel:{},combo:{},config: {}
                });
                Ext.reg('quickcmp',QuickCMP);
                
                var QuickCMP = new QuickCMP();
                
                QuickCMP.page.Object = function(config) {
                    config = config || {};
                    Ext.applyIf(config,{
                		components: [{
                            xtype: 'box'
                            ,id: 'quickcmp-box'
                        }]
                
                    }); 
                    QuickCMP.page.Object.superclass.constructor.call(this,config);
                };
                Ext.extend(QuickCMP.page.Object,MODx.Component);
                Ext.reg('quickcmp-page-home',QuickCMP.page.Object);
                
                Ext.onReady(function() {
                
                    var qcmp = MODx.load({ 
                		xtype: "quickcmp-page-home"
                    });    
                	
                    var panel =Ext.getCmp("quickcmp-box");
                    var el = Ext.get("my-cmp-div");
                    el.appendTo(panel.el);
                    
                });
                
                


                should we add this to http://rtfm.modx.com/display/revolution20/Custom+Manager+Pages somewhere?

                btw.: still have an empty name on rtfm. Don’t know how I can get one.
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!