We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37099
    • 338 Posts
    If you want to let front end users use their Twitter accounts to log in, I've written an article that describes how to do that.

    http://bit.ly/1csXKKe

    Mike
      • 3749
      • 24,544 Posts
      Very cool thanks.

      You asked how to make it a package. Check out MyComponent. http://bobsguides.com/mycomponent-tutorial.html.

      It takes a little getting used to, but it will save you a ton of time when creating packages.

        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
        • 37099
        • 338 Posts
        Thanks Bob,

        I'll have another look at MyComponents, I had a quick look before trying to do a Doodles type example with it but I quickly got confused with the paths I was creating having previously done the Doodles tutorial where it is developed outside the modx filesystem.

        Cheers
        Mike
          • 3749
          • 24,544 Posts
          MyComponent *should* put everything in the same places as the Doodles tutorial except that the root will be:

          assets/mycomponents/componentName/
            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
            • 37099
            • 338 Posts
            So I guess you don't need to bother with the core_path settings as in Doodles?

            Developing outside modx seemed like a good idea, in the Doodles tutorial it says there are advantages:

            Allows immediate development straight from your Git repository
            Allows easy collaboration between developers, as there is no copying files or changing core files - just developing in your preferred IDE and then doing some initial setup on paths.
            Allows isolation of your code to be independent of MODX's core - so if you need to move it, you can do it in only one place.

              • 3749
              • 24,544 Posts
              All those are true of the MyComponent placement too. It's still independent of MODX, it just happens to be in a directory under the MODX assets directory (which MODX will never touch during an upgrade).

              I like having all my projects under assets/mycomponents. I have all of them and the MODX install as a single project in PhpStorm. I can do a quick search for anything I've written and all my projects are in the same tree in the editor, which is handy for moving files and bits of code from one project to another (which I do all the time). I can also jump instantly from a call in my code to any MODX method to the code of that method.
                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
                • 37099
                • 338 Posts
                That's interesting to know.

                I like the sound of everything as a single project in Phpstorm too.

                I'm just working through the Doodles tutorial again, when i've done I'll take another look at MyComponents to try and grasp the concepts and work it out again.

                Thanks
                Mike
                  • 3749
                  • 24,544 Posts
                  MyComponent looks really scary at first, but it's actually not all that difficult to use (really). Other than writing your code (which you have to do anyway), the only thing it adds is editing the project config file -- and the way it does all your lexicon strings for you, creates *all* your files in skeleton form complete with license and sometimes partial code, and creates *all* the build files automatically (including all resolvers) is a huge bonus.

                  It cuts my Extra development time by at least a factor of 10. If you're only doing one Extra, it might not be worth it, but if you'll do more, or if you'll be updating your Extra, it definitely pays to use it.

                  I did a presentation on MyComponent at MODXpo where I created a brand new Extra from start to finished transport.zip file (complete with lexicon strings) in about 15 minutes. That includes typing in the snippet code with no cutting-and-pasting. There is a video of that presentation, but sadly it's never been released.

                  TBH, I've never actually done the Doodles tutorial, though I've looked at parts of it a number of times. The problem is that it mixes up creating a CMP using modExt and creating custom xPDO classes. These are really two separate things. A CMP doesn't necessarily need custom database tables and custom database tables don't necessarily need a CMP.

                  Trying to learn them both at the same time can get really confusing, imo.
                    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
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Plus the Doodle tutorial has you working in a directory external from your MODx installation, so there's a lot of baggage related to getting MODx to be able to find and work with your application files.

                    With MyComponent, you work within the MODx system, exactly as your files will be when it's an installed component.
                      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
                      • 37099
                      • 338 Posts
                      Yes, half the difficulty with the Doodles tutorials is getting the paths right for your particular setup which distracts from and obscures the main concepts a bit.