We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34078
    • 76 Posts
    Thanks again lossendae wink
      • 21122
      • 153 Posts
      With the help of Mark Hamstra, I’ve just managed to get a related pages snippet working properly, with the related resources being selected from a multiple listbox. So when I saw this little add-on, I thought I’d try it out.

      I’ve followed the instructions on the site, and I have it working, but there is one bug. Its only letting me select top-level pages, and doesn’t list them if they are a container. I have a pretty hefty site, about 60 pages perhaps, and much of it is stored in a container.

      The Input Option Value of my TV is "@SELECT pagetitle,id FROM `modx_site_content` WHERE parent BETWEEN ’2’ AND ’58’". This displayed all pages between those values when I was using a multiple list box, but not anymore.

      Any thoughts??

      Oh, and before I forget, Ben, this work is brilliant! Your Colour Picker Tv looks great oo. Can’t wait to use it!
        • 34078
        • 76 Posts
        Thanks neilp123. wink

        This is just a beta version so it’s pretty limited for now.

        You can specify the id of the parents of the resources you want to be able to select. By default, containers aren’t selected.

        Until I fix the bug you can edit the fetch_resource.php in {modx_path}/assets/components/superboxselect/.

        Replace line 35 :
        'isfolder' => 0,

        by
        'isfolder' => 1,


        And in Input Option Value :
        @SELECT id FROM `modx_site_content` WHERE id BETWEEN '2' AND '58



          • 21122
          • 153 Posts
          Hi Ben,

          Thanks for that. I did actually go through the superbox.php file to see if there was anything that might be just fetching documents and not folders. Its nice to have a bit of control over what is being selected. I’ve managed to alter my SQL request so its pulls in the exact resources I want!

          Thanks for the help, and may the excellent snippets continue!
            • 34078
            • 76 Posts
            Quote from: Romain at May 10, 2011, 11:12 AM

            Lots of views, not much replies…

            Much thanks for your work .ben. This seems to be a really good replacement for the autotag TV which can become messy.
            By the way, a Github repo will be welcomed ^^

            Cheers

            Here is the github : https://github.com/omycode/SuperBoxSelect
              • 21122
              • 153 Posts
              Hi Ben,

              I’ve just realised something very strange with this snippet. I posted about an issue I noticed here http://modxcms.com/forums/index.php/topic,64430.0.html.

              Basically, when I opened a resource, TinyMCE wouldn’t load, and the SuperBoxSelect dropdown would load properly either (in the TV tab). But it did load in one or two of my resources. No idea why that happened. However, I removed the template access on the SuperBoxSelect TV, and all of my resources now load properly.

              Any reason why you think this could be happening?

              Thanks
                • 34078
                • 76 Posts
                Maybe a JS issue ... huh You can use Firebug to try to debug it.
                • Is there any chance someone could tell me how I can use this in a CMP?

                  I have been trying to use it instead of ComboBox for a dropdown but I don’t seem to quite get it working.

                  Cheers!
                    Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                    AugmentBLU - MODX Partner

                    BLUcart - MODX Revolution E-Commerce & Shopping Cart
                    • 28215
                    • 4,149 Posts
                    Look into:

                    manager/templates/default/element/tv/renders/input/listbox-multiple.tpl
                      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                    • Hello,

                      I tried the following but hasn’t worked.

                      I have included the SuperBoxSelect.js file in the CMP, I guess this is the long route of doing it? Then in a grid.js I have this code

                      Staffmembers.SuperBoxSelect = function (config) {
                          config = config || {};
                      Ext.applyIf(config, {
                      xtype:'superboxselect'
                              ,transform: 'test'
                              ,triggerAction: 'all'
                              ,mode: 'local'
                              ,extraItemCls: 'x-tag'
                              ,width: 350
                      	,fields: ['role']
                              ,displayField: "role"
                              ,valueField: "role"
                          });
                          Staffmembers.SuperBoxSelect.superclass.constructor.call(this, config);
                      };
                      Ext.extend(Staffmembers.SuperBoxSelect, Ext.ux.form.SuperBoxSelect);
                      Ext.reg('SuperBoxSelect', Staffmembers.SuperBoxSelect);
                      


                      Then I call the xtype using
                      {
                      	    ,xtype: 'SuperBoxSelect'
                                  ,fieldLabel: _('staffmember.role')
                                  ,name: 'role'
                                  ,width: 400
                              }
                      


                      I’m getting use to CMPs but not quite there with extending extjs quite yet! No doubt completely wrong but some pointers should get me there. I did check the listbox-multiple.tpl, still failed! laugh
                        Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                        AugmentBLU - MODX Partner

                        BLUcart - MODX Revolution E-Commerce & Shopping Cart