We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    The resolver (usually your default resolver, though IIRC it can be any resolver) has access to the inputs in the form created by user.input.php like this:

    $value = $modx->getOption('field_name', $options, 'default_value');
      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
      • 42562
      • 1,145 Posts
      Thank you, thank you.
      I think I understand you.
      I am so excited to go try it out.

      I wonder if this can also magically work with
          'assetsDirs' => array(
              /* If true, a default (empty) CSS file will be created */
              'css' => true,
              'js' => true
          ),
      to control the installation of hard files.
      Is there even a separate resolver for that?
        TinymceWrapper: Complete back/frontend content solution.
        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
        • 3749
        • 24,544 Posts
        I'm afraid I don't understand your question. That code will cause stubs to be created for the two files. IIRC, they'll be based on the Tpl chunks, but you can substitute your own Tpl chunks (using the 'my' prefix).

        You can put any code you like in the default resolver and perform as many tasks there as needed.
          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
          • 42562
          • 1,145 Posts
          One month, and I am still scratching my head and how to allow users choose ...
          I am not even sure I understand myself.


          For anyone and for posterity:
          MyComponent frowns upon empty elements and resources

          - just found that one out
            TinymceWrapper: Complete back/frontend content solution.
            Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
            5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
            • 3749
            • 24,544 Posts
            I'm not sure what you mean. What problems do you have when you leave their content blank?
              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
              • 42562
              • 1,145 Posts
              They will not be exported at all when you Export Objects. I can see the reason, what's the point in packaging empty stuff into an extra....
                TinymceWrapper: Complete back/frontend content solution.
                Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                • 42562
                • 1,145 Posts
                By the way, I am rocking MyComponent, and it's 2016.

                Thanks so much for making this tool
                  TinymceWrapper: Complete back/frontend content solution.
                  Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                  5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                  • 3749
                  • 24,544 Posts
                  Thanks. smiley

                  BTW, I looked at the code and it looks like objects with empty content would be exported fine. Maybe I'm missing something.

                  For resources, they would have to be specified directly in the project config file by pagetitle, ID, or parent (since they don't belong to categories).
                    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
                    • 42562
                    • 1,145 Posts
                    donshakespeare Reply #49, 8 years ago
                    Okay, I am back.
                    I have three mild questions that are stumping me immensely

                    1. Is it possible to set default value of file/image TVs with user's assets' url (no MODX tag)? Something like MODX_ASSETS_URL translated server-side to proper url
                    [[++assets_url]] works okay in the frontend, but in the Manager, phpThumb will not parse MODX tags and thus throw a thousand errors each time.

                    2. I have been trying to understand user input and default resolver and all, but no progress. I want to make a LITE version of my Extra. I don't want certain asset folders to be installed, and chunks and demo resources

                    3. Does MyComponent respect the new dependency thing I am hearing about? Main Extra won't install unless all subpackages have been installed.

                    Many thanks in advance.
                      TinymceWrapper: Complete back/frontend content solution.
                      Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                      5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                    • #3, no.
                        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