We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42562
    • 1,145 Posts
    donshakespeare Reply #61, 8 years ago
    You are right about just doing this
    MODX_ASSETS_URL.'/components/myExtra/images/bliss.jpg';

    Only here do I need that extra slash because basename will not include it.
    basename(MODX_ASSETS_URL).'/components/myExtra/images/bliss.jpg')

    becomes
    assets/components/myExtra/images/bliss.jpg)


    After a billion tests, those errors come up only when rendering the said resource in the Manager.

    Now I am going to try to solve my question #2 about creating resources/chunks/ assets files only on user-selected option.
    #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
      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
      Take a look at the user.input.php script in the MyComponent Example project and the comments in it.

      Chapter 13 of my book has a complete example of how to respond to user input during the install in a transport package (and a lot of other info about transport packages). If you have the e-book, search for user.input.php
        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
        • 14020
        • 75 Posts
        After years of using packMan to create the simple transport files for my snippets I decided to get up to speed with myComponent. Naturally I went to you fine tutorial and started following the steps with the example file. Unfortunately for me I got stuck at number 4 when I found no directory named "core/components/mycomponent/config" There was one named "core/components/mycomponent/_build/config" with the "/example.config.php" file in it but that is NOT what it says in the tutorial, both the one on you site and the one included in the docs. Am I doing something wrong? This is in a test site, Modx 2.5.1-pl, with nothing but myComponent installed.
          • 42562
          • 1,145 Posts
          I can't see where this ominous #4 is but your main concern is
          core/components/mycomponent/_build/config/yourExtra.config.php
            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.
            • 14020
            • 75 Posts
            Quote from: donshakespeare at Nov 04, 2016, 07:10 PM
            I can't see where this ominous #4 is but your main concern is
            core/components/mycomponent/_build/config/yourExtra.config.php

            The number 4 comes from the spot in the tutorial that says:

            4. Take a look at Example project config file (core/components/mycomponent/config/example.config.php). This is similar to the one you will use for your project, though yours will probably be much simpler. The Example config file contains an example of almost everything you might want to do with MyComponent.

            I can find no such directory so I can not look at that file? Is it just a typo in the tutorial? or is Bootstrap not creating the directory and file? [ed. note: jerry325 last edited this post 7 years, 5 months ago.]
              • 42562
              • 1,145 Posts
              I think it might have been a typo ...

              On my system, there is no \core\components\mycomponent\config\ folder
              Only \core\components\mycomponent\_build\config\


              QUICK STEPS

              1. Put all your MODX elements under the same-name category, which should be the name of your Extra
              2. Open/View MyComponent Resource - enter exact name of your extra, and create new project
              3. Carefully edit the \core\components\mycomponent\_build\config\yourExtra.config.php
              4. Go back to MyComponent Resource (1) Bootstrap... (2) Export Objects... (3) Build
              5. Enjoy
                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
                Definitely a typo. I've fixed it. It's amazing that no one has noticed it before.

                Thanks for the heads up. smiley
                  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
                  Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.
                    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.
                    • 14020
                    • 75 Posts
                    Quote from: BobRay at Nov 05, 2016, 05:05 AM
                    Definitely a typo. I've fixed it. It's amazing that no one has noticed it before.

                    Thanks for the heads up. smiley
                    And here I thought I was the only one who did stuff like that. Thanks BobRay! I think I am finally getting a handle on this app. I'll post back if anything else perplexes me. smiley
                      • 14020
                      • 75 Posts
                      New Question:

                      I have a small snippet named getFolders. I usually use it within my getImages snippet but it works fine on it's own and at one time I had a working version of it in the repository. I had used packMan to create the transport. I did a minor upgrade and when I tried to upload the change it became corrupted and since then I am unable to create a new transport package for it in either packMan or now using myComponent. It simply fails and their is nothing in the logs. This is what I get when clicking build: "Could not find build.transport.php at: /var/www/clients/client3/web29/web/assets/mycomponents/getfolders/_build/build.transport.php"