We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8609
    • 607 Posts
    Quote from: lossendae at Oct 04, 2009, 10:29 PM

    I would really love a tutorial on how to hook up any third party application to the MODx system.
    In a relatively extended way, with a case to study, showing a way to use the same login informations for both system (with the MODx API and xPDO) and showing how to set basic user level too in MODx for authorization (in the same scenario).

    I also think that a tutorial on how to make template and bundle it in a package with a bunch of options could really be appreciated.



    Agreed!! These would be excellent tutorials to see smiley
      • 28215
      • 4,149 Posts
      Quote from: lossendae at Oct 04, 2009, 10:29 PM

      I would really love a tutorial on how to hook up any third party application to the MODx system.
      Loading MODx externally can be found here:

      http://svn.modxcms.com/docs/display/revolution/Loading+MODx+Externally

      In a relatively extended way, with a case to study, showing a way to use the same login informations for both system (with the MODx API and xPDO) and showing how to set basic user level too in MODx for authorization (in the same scenario).

      A few questions:
      1. "Login informations" what do you mean? You mean login/logout, etc? User sessions? Using the $modx->user object? Not sure what specifics you want here.

      2. User level? What does that mean? Does that mean a User Group? A role within that group? An authority level of a group role? Some docs are here:
      http://svn.modxcms.com/docs/display/revolution/Roles
      http://svn.modxcms.com/docs/display/revolution/User+Groups
      http://svn.modxcms.com/docs/display/revolution/ACLs
      http://svn.modxcms.com/docs/display/revolution/Policies

      But could you elaborate on what you want?

      I also think that a tutorial on how to make template and bundle it in a package with a bunch of options could really be appreciated.
      What options? This gets a bit complex - is this template being bundled with TVs? Chunks? Properties? etc...
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
      • * Compare a basic CRUD operation with other frameworks (this would be huge in luring in developers from other platforms).
        Great idea; but I guess i’d have to know what all entails a "basic CRUD operation", and what that operation is being performed on.

        I’m asking for examples of how to use MODx and xPDO to do the dance between code and HTML forms that comprise the "Create", "Read", "Update", and "Delete" operations that are the foundation of so many web applications.

        The "Read" option is the simplest... just justing xPDO and MODx (but it would be good to review it in Revo), but also show the new formatting options AND it would be useful to show recommended ways of passing URL values etc. to the model. E.g. where yoursite.com?id=123 becomes infused with the database query of "WHERE id=’123’";

        The create and update operations are more complex because they involve a form and a form handler. What’s a recommended way for using forms to pass data to a handler? Should the handler be the same page that houses the form? How about validation? If the form fails validation in the PHP layer, how can you repopulate the form data or issue error warnings without going through the nasty slop of php/html that comprises most web forms.

        That’s the pot of gold at the end of the rainbow with any CRUD system, and that’s what I’d love to see as a MODx tutorial.
          • 15170
          • 90 Posts
          Documentation without demo content is very difficult to understand.
          For example where does the css file go?
          • Quote from: splittingred at Oct 05, 2009, 06:44 PM

            In a relatively extended way, with a case to study, showing a way to use the same login informations for both system (with the MODx API and xPDO) and showing how to set basic user level too in MODx for authorization (in the same scenario).

            A few questions:
            1. "Login informations" what do you mean? You mean login/logout, etc? User sessions? Using the $modx->user object? Not sure what specifics you want here.

            2. User level? What does that mean? Does that mean a User Group? A role within that group? An authority level of a group role? Some docs are here:
            http://svn.modxcms.com/docs/display/revolution/Roles
            http://svn.modxcms.com/docs/display/revolution/User+Groups
            http://svn.modxcms.com/docs/display/revolution/ACLs
            http://svn.modxcms.com/docs/display/revolution/Policies

            But could you elaborate on what you want?

            For example, let’s say that i want to write a plugin to allow a user to connect on my MODx website with his Twitter account.

            How i can i do that ? How do i plug the external application into MODx? Should i stock the token in the database ?
            If the user has already an account with a MODx Password but want to connect himself with his Twitter account, how can i manage that case ?

            I talked about Twitter because the process could be the same with any third party after. The exemple can be a good base to let the communauty build their own plugin for facebook, or any social application.

            On the same subject, if i want to use SMF within MODx, should i use xPDO? How do i manage the session between each system.

            I also think that a tutorial on how to make template and bundle it in a package with a bunch of options could really be appreciated.
            What options? This gets a bit complex - is this template being bundled with TVs? Chunks? Properties? etc...

            Exactly.

            A guide to build a complete theme ready to use.

            With several options, bundled snippets, chunks and TV’s. If possible, a way to verify if bundled snippet’s are already installed.

            Let’s say a basic theme with:


            • A tv to control the layout (1 or 2 columns)
            • Quip bundled with verification
            • Chunks related to the theme
            • An installation process to set basic informations
            • Quote from: jzigbe at Oct 10, 2009, 06:19 PM

              Documentation without demo content is very difficult to understand.
              For example where does the css file go?
              It’s no different than in Evo or 0.9.x. You can put it anywhere on the filesystem, on a CDN, or create a CSS Resource in MODx.

              Demo content is good, but also can lead people to believe there is only one way to do something, which is generally not true in MODx and can limit innovation. That said, when we release MODx 2.0.0 final, we we also be putting various demo content packages in the Extras repository for people to download and explore with various examples. Hopefully folks will start creating some packages like this and contributing them as well.

              Quote from: Everett at Oct 06, 2009, 05:44 AM

              I’m asking for examples of how to use MODx and xPDO to do the dance between code and HTML forms that comprise the "Create", "Read", "Update", and "Delete" operations that are the foundation of so many web applications.

              The "Read" option is the simplest... just justing xPDO and MODx (but it would be good to review it in Revo), but also show the new formatting options AND it would be useful to show recommended ways of passing URL values etc. to the model. E.g. where yoursite.com?id=123 becomes infused with the database query of "WHERE id=’123’";
              You do this as you would in any PHP script, using REQUEST variables. Then use the methods of xPDO, like getObject() to READ the data. At that point you can do whatever you want with it, though the most basic operation would be to $modx->setPlaceholders() with the data or use $modx->parseChunk() to isolate the placeholders into the scope of a Chunk. And these are just the simplest operations; the possibilities are endless. But for sanity’s sake, here is an example:
              $objID = $_GET['objID'];
              $object = $modx->getObject('myObjectClass', $objID);
              return $modx->parseChunk('myObjectChunk', $object->toArray());


              Quote from: Everett at Oct 06, 2009, 05:44 AM

              The create and update operations are more complex because they involve a form and a form handler. What’s a recommended way for using forms to pass data to a handler? Should the handler be the same page that houses the form?
              That’s up to you and your needs. It could be the same page or separate depending on how you write your scripts. You may want to process it with a Resource that accepts Ajax requests and returns JSON responses, or you may want to simply read the POST and process it. Using $myObject->fromArray($_POST) and $myObject->save() is the simplest way to create or update xPDO objects from these requests, assuming you name the POST variables the same as the object fields.

              Quote from: Everett at Oct 06, 2009, 05:44 AM

              How about validation?
              See the xPDO Validation documentation first, then use the validation responses to build and present error messages to the user and present the form again, perhaps with placeholders filled in with error classes. Or use Ajax to process the form in another Resource and return JSON data that is processed by a script on your form that highlights the fields that fail validation.

              Quote from: Everett at Oct 06, 2009, 05:44 AM

              If the form fails validation in the PHP layer, how can you repopulate the form data or issue error warnings without going through the nasty slop of php/html that comprises most web forms.
              Save the POSTed data to SESSION, or if you need it to persist past the session, you could look into the modRegistry service which is like a basic message queue. Examples of modRegistry will be coming, but you can find basic usage examples of it in the MODx core, specifically the read.php and send.php in core/model/modx/processors/system/registry/register/.

              Quote from: lossendae at Oct 10, 2009, 11:51 PM

              For example, let’s say that i want to write a plugin to allow a user to connect on my MODx website with his Twitter account.

              How i can i do that ? How do i plug the external application into MODx? Should i stock the token in the database ?
              If the user has already an account with a MODx Password but want to connect himself with his Twitter account, how can i manage that case ?

              I talked about Twitter because the process could be the same with any third party after. The exemple can be a good base to let the communauty build their own plugin for facebook, or any social application.
              Store the token in the properties of your Snippet, or in a custom table, or in user settings. This process is going to be different for every 3rd party service and the way you want to use it. And this has nothing to do with the MODx security system, so I don’t think that was really relevant to Shaun’s question. It seems like you are asking us to write complete components for you. But this is a framework with an API for programmers to build the components with. Start by learning the API and asking developer questions.

              Quote from: lossendae at Oct 10, 2009, 11:51 PM

              On the same subject, if i want to use SMF within MODx, should i use xPDO? How do i manage the session between each system.
              Do you want SMF to be the user system or MODx? Or do you want to synchronize the user systems? Each system manages it’s own sessions so the answer to that is, you can’t, but you could write a custom user class or session handler class. However, these are advanced solutions that require intimate knowledge of the workings of the core API. There are no simple answers and we’re likely not going to have time to figure this out for SMF unless someone is funding the effort. We use SMF at modxcms.com and have no user integration with SMF because it is a very difficult and time consuming task, IMO, because SMF does not have web services for handling this and requires you to write hooks that are very complex (at least that’s my opinion).

              Quote from: lossendae at Oct 10, 2009, 11:51 PM

              I also think that a tutorial on how to make template and bundle it in a package with a bunch of options could really be appreciated.
              What options? This gets a bit complex - is this template being bundled with TVs? Chunks? Properties? etc...

              Exactly.

              A guide to build a complete theme ready to use.

              With several options, bundled snippets, chunks and TV’s. If possible, a way to verify if bundled snippet’s are already installed.

              Let’s say a basic theme with:


              • A tv to control the layout (1 or 2 columns)
              • Quip bundled with verification
              • Chunks related to the theme
              • An installation process to set basic informations
              These will come in time, but there are hundreds of combinations that could be realized here and everyone probably wants a different set.

              We need folks with PHP knowledge to explore the API, core processors and component build scripts in our public modx-components SVN, learn about them, innovate with them, and help us contribute to this effort. We can’t wait for Shaun and I to exemplify every possibility in a tutorial, because there are simply too many things to cover. And every single one of these things is exemplified in the MODx core already (at least from a PHP coding perspective). I’m not saying we aren’t going to write more documentation, tutorials, or components that exemplify these things, but we could sure use some help... please? wink Remember, we also have to fix bugs, prepare core releases and do client work to feed ourselves.
              • Store the token in the properties of your Snippet, or in a custom table, or in user settings. This process is going to be different for every 3rd party service and the way you want to use it. And this has nothing to do with the MODx security system, so I don’t think that was really relevant to Shaun’s question.

                It seems like you are asking us to write complete components for you.

                But this is a framework with an API for programmers to build the components with. Start by learning the API and asking developer questions.

                i thought that you’d have come to this point.

                In order to test Revolution, i have already done some components to work with third parties integration.

                The point for a complete tutorial, even is they are many ways of doing it, is just to show how you would have done it.

                Then developpers (not forcefully the best one of them) can see what you’ve done and try to put their own magic in it.

                The case might have been too specific for you but i thought it was a good exemple. Social services integration is a must nowadays.

                Do you want SMF to be the user system or MODx? Or do you want to synchronize the user systems? Each system manages it’s own sessions so the answer to that is, you can’t, but you could write a custom user class or session handler class.

                However, these are advanced solutions that require intimate knowledge of the workings of the core API. There are no simple answers and we’re likely not going to have time to figure this out for SMF unless someone is funding the effort.

                We use SMF at modxcms.com and have no user integration with SMF because it is a very difficult and time consuming task, IMO, because SMF does not have web services for handling this and requires you to write hooks that are very complex (at least that’s my opinion).

                Fair enough.

                I’ll just have to stay with Fluxbb/Punbb and wait for Shaun’s native forum component. smiley

                These will come in time, but there are hundreds of combinations that could be realized here and everyone probably wants a different set.

                We need folks with PHP knowledge to explore the API, core processors and component build scripts in our public modx-components SVN, learn about them, innovate with them, and help us contribute to this effort. We can’t wait for Shaun and I to exemplify every possibility in a tutorial, because there are simply too many things to cover.

                And every single one of these things is exemplified in the MODx core already (at least from a PHP coding perspective).

                I’m not saying we aren’t going to write more documentation, tutorials, or components that exemplify these things, but we could sure use some help... please? Wink Remember, we also have to fix bugs, prepare core releases and do client work to feed ourselves.


                My personal opinion on that matter don’t differ from yours.

                Writing good Documentations is a long process and it’s not an easy task.
                Kudos for you guys, so far you’re doing an awesome job.
                  • 28993
                  • 42 Posts
                  I would suggest a good end user documentation about making pages / making links / uploading movies etc... for the content editors.

                  Maybe showing it in how to video’s hosted on youtube for example (embedding them in de MODx manager), with a script to translate in other languages asswel.
                    • 5916
                    • 13 Posts
                    I would love to get more insight on how to package and submit add-ons. I’ve had a working user registration script for Revolution for like two months now, and I got that e-mail response from splittingred like right away that said just to "send it over in a zip file", but I would much prefer to submit it as a whole package (and maybe get credited for writing it in the process).

                    We redesigned our site to reflect the direction the boss wants to go in, which involves selling SOAPware EMR Software. At that site you can see a working user registration script, complete with e-mail confirmation by an expiring hashed link and a "lost password" feature.

                    I’d also like to know if there’s any special rules for upgrading Revolution from beta3 to beta4; that information is probably in a README file somewhere, though, so no big deal if I’m being redundant. Get mad at me if my CODE is redundant. XcD
                      _________________________________________________________
                      Name's Crates. Just Crates is fine.

                      I work for Access Technology Group, which lately
                      has been selling SOAPware EMR Software as its primary
                      business model. We're trying to get into health care.

                      Drop by the site if you'd like an example of a working,
                      robust web site running on MODx Revolution 2.0.0 (beta-3
                      at the moment; currently upgrading to beta-4).

                      If for any reason you need to reach me personally, I am
                      Typing at G Mail dot Com. Yes, that's my address.
                      _________________________________________________________
                      • 28215
                      • 4,149 Posts
                      Quote from: Crates at Nov 09, 2009, 03:06 PM

                      I would love to get more insight on how to package and submit add-ons. I’ve had a working user registration script for Revolution for like two months now, and I got that e-mail response from splittingred like right away that said just to "send it over in a zip file", but I would much prefer to submit it as a whole package (and maybe get credited for writing it in the process).
                      http://svn.modxcms.com/docs/display/revolution/Creating+a+3rd+Party+Component+Build+Script


                      I’d also like to know if there’s any special rules for upgrading Revolution from beta3 to beta4; that information is probably in a README file somewhere, though, so no big deal if I’m being redundant. Get mad at me if my CODE is redundant. XcD
                      Upload files. Run setup.
                        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com