We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    I realize I’m extremely dense when it comes to reading documentation: if I can interpret something in more than one way, I usually trainwreck, but hopefully my OCD-nature has helped clarify things in the MODx wiki....

    So I’m looking at http://rtfm.modx.com/display/ADDON/modExtra and I’m baffled... e.g. "create the target directory where you want to create the file"... what? And could someone explain where I might want to install my new repo? I would assume I’d be doing dev work in core/components/my_new_component -- is that the path I should specify with this:
    it archive HEAD | (cd /path/where/I/want/my/new/repo/ && tar -xvf -)


    ???

    And I’m trying to follow along with Bob’s guide here: http://bobsguides.com/mycomponent-tutorial.html

    but without understanding the first part of this, I’m having a hard time. Can someone clarify the startup process here?
      • 3749
      • 24,544 Posts
      You do realize that you can just install GetMyComponent and the directories will all be created for you, right? You can just copy the mycomponent folder to a your_new_component directory at the same level.

      MyComponent is designed so that you can just replace or modify the code in the files, set the options in build.transport.php and run it to create your package.
        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
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        Thanks Bob... I don’t see "modExtra" showing up anywhere in package management, so I’m afraid that option went out the window about an hour ago. I think it might be better to do the git install though, isn’t it? That way I can develop my extra outside of the MODx docroot, right?

        You better look over the stuff I’m adding to the wiki to see if it’s remotely applicable.
          • 3749
          • 24,544 Posts
          Quote from: Everett at Apr 18, 2011, 09:59 PM

          Thanks Bob... I don’t see "modExtra" showing up anywhere in package management, so I’m afraid that option went out the window about an hour ago. I think it might be better to do the git install though, isn’t it? That way I can develop my extra outside of the MODx docroot, right?

          You better look over the stuff I’m adding to the wiki to see if it’s remotely applicable.

          MyComponent is a separate (*much* bigger -- over 70 files) package that you install using the GetMyComponent package (which is definitely available in Package Manager / Download Extras). MyComponent is unrelated to modExtra (except for being inspired by much of its code) and doesn’t require or use modExtra at all. IOW, MyComponent is an alternative to modExtra.

          I think modExtra may be somewhat out of date. I’m not sure. While modExtra gives some examples of how to build a package and perform certain tasks, in MyComponent, I tried to give an example of *everything* you might want to do in a transport package (except handle security permissions). In addition, MyComponent is designed to let you copy it to a folder, plug in your code, do some search and replace operations, set some variables, and then run build.transport.php to create a complete, finished transport package for your own component that’s ready to release (and it has a tutorial).

          It places all the possible files you might need in their correct locations. I’ve used it to build several packages very quickly and easily. The last package I created took an hour or two from finishing the component’s code to uploading the package to the repository. Doing it from scratch would have taken me about a week.


          You can definitely run MyComponent outside of MODX and you could locate it outside the web root with a little fiddling, but I’m not sure why you’d want to do that -- I’m assuming that you’d do any package building on a localhost install.

          I don’t mean to hijack the thread. I just wanted to clarify the difference between modExtra and MyComponent.
            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
            • 9207 ☆ A M B ☆
            • 2,475 Posts
            You’re not hijacking this at all: there is precious little information about building components and your experience here is hugely valuable. I didn’t even realize MyComponent was a separate package -- I thought it was an implementation of modExtra. Wow. Well, I’m gonna give it a try. ... so far so good. What’s the reason to put the mycomponent into assets/? Is there a reason why it should go there instead of into core/components?

            Thanks, as always.
              • 9207 ☆ A M B ☆
              • 2,475 Posts
              Bob, your inbox is full wink