We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28494
    • 32 Posts
    Quote from: splittingred at Oct 06, 2009, 03:33 PM

    Quote from: stephenrs at Oct 06, 2009, 02:17 PM

    Sounds great. I’ll eagerly await public availability of Discuss, good luck bringing it along.

    I’ve put the code in SVN, at modx-components. There’s also a demo video of Discuss I made a while back. Feel free to check them out.

    Wow, that was a fast month wink

    I svn co-ed, have taken a quick look around and am immediately comforted with the way things are organized.

    A couple initial questions:

    1. Are the directory layout and file naming conventions of Discuss the result of a team-internal standardized practice, or is it your own invention? (or both?)

    2. I’m guessing that to use the component with an existing MODx install, I’d merge the Discuss files into my core and assets directories...or should I run one of the _build scripts?...but then what? If this is not correct, or the answers to these have already been documented somewhere (or you’re not ready to start answering support questions), an answer of RTFM is fine.

    I’ve got a kick-off and a launch deadline converging this week, so I may go a bit silent here, but as you might have guessed I’m itching to give the developer-centric (sorry, couldn’t help it wink) side of MODx a whirl in whatever spare moments I can find.

    Having a complete application like this to play with makes the abstract nicely concrete - thanks. It’s starting to look like my initial query in the subject of this thread is getting answered...mark it [SOLVED]? smiley
      • 28215
      • 4,149 Posts
      Quote from: stephenrs at Oct 06, 2009, 04:36 PM

      Wow, that was a fast month wink
      Well, it’s not a working copy yet. tongue


      1. Are the directory layout and file naming conventions of Discuss the result of a team-internal standardized practice, or is it your own invention? (or both?)
      A little bit of both; Jason and I have worked out the details on 3PC development in the last year or so.


      2. I’m guessing that to use the component with an existing MODx install, I’d merge the Discuss files into my core and assets directories...or should I run one of the _build scripts?...but then what? If this is not correct, or the answers to these have already been documented somewhere (or you’re not ready to start answering support questions), an answer of RTFM is fine.
      Well, depends on what you mean by *use*. If you’re wanting to develop Discuss, Discuss allows you to set the assets path and url, and the core path and url via System Settings, so you could theoretically checkout Discuss as a project in say, Eclipse, and then do real-time work straight from those files. (That’s how I do it.)

      Now, when Discuss gets a bit more stable, and I’ve finished the build script, you’ll instead just run the build.transport.php, and it will create a zip file that you can then go in Revo to Package Management -> Add New Package -> Scan Locally. This will then make the package show up, and you’ll just right-click on it and hit install. Then a setup options dialog (and a readme and license agreement) will appear, you’ll put in your options (which aren’t done yet) and it’ll automatically install everything, files included, for you. All you’ll do after that is customize it to your liking.

      I’ve got a kick-off and a launch deadline converging this week, so I may go a bit silent here, but as you might have guessed I’m itching to give the developer-centric (sorry, couldn’t help it wink) side of MODx a whirl in whatever spare moments I can find. Having a complete application like this to play with makes the abstract nicely concrete - thanks. It’s starting to look like my initial query in the subject of this thread is getting answered...mark it [SOLVED]? smiley
      Well, it’s not a *complete* application yet, but you can get a lot of the ideas from it. tongue Thanks Stephen, and good luck on your deadline.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 28494
        • 32 Posts

        Well, depends on what you mean by *use*.

        What I meant by *use* was: how do I view the application in all its glory as seen in the video demo of Discuss? I’m assuming the snippets, chunks, etc that I see in the directory tree need to somehow be installed in MODx first.


        If you’re wanting to develop Discuss, Discuss allows you to set the assets path and url, and the core path and url via System Settings,

        Again, I’m assuming these settings would need to be applied *after* MODx was made aware of the existence of Discuss. So far, all I’ve been able to do is inspect the code and directory layout.


        so you could theoretically checkout Discuss as a project in say, Eclipse, and then do real-time work straight from those files. (That’s how I do it.)

        I can come up with a way to structure things to keep disparate svn trees from conflicting, and I do use Eclipse for some projects...but I’ve lately been using Coda for smaller projects - and incidentally, the more I use Coda the more I’m starting to forget the reasons I liked Eclipse smiley ...but that’s a whole ’nother thing...

        Anyway, what I’m wondering now though is about the real-time work you mention above, and as it relates to an earlier part of the discussion:

        Quote from: stephenrs

        Also, I read somewhere in the official MODx docs that the suggested workflow was to first test snippet code outside MODx, then paste it into the snippet box. For the many developers like me who are always looking for ways to speed up their development process, this is a conversation ender. I’d almost rather teach PHP to every designer I’ve ever had to work with Wink

        Quote from: splittingred

        Well, those docs need to be corrected then.

        What is the suggested iterative development/testing/debugging workflow, particularly with regard to snippets, chunks, and templates? ie, in what way should the docs be corrected to facilitate real-time development - is there a way to avoid duplicating code?

          • 28494
          • 32 Posts
          And a followup to the above question, in case the answers are different: What is the suggested development workflow for modifying 3PC’s - in the scenario where the code (chunk, snippet, or otherwise) of an existing component needs to be modified to suit a particular requirement.

          Both questions (probably quite obviously at this point) come from the perspective of a developer choosing to not maintain project code via the MODx UI - and wishing to have available an efficient development workflow under the MODx umbrella.
            • 28215
            • 4,149 Posts
            Quote from: stephenrs at Oct 15, 2009, 12:32 AM

            What I meant by *use* was: how do I view the application in all its glory as seen in the video demo of Discuss? I’m assuming the snippets, chunks, etc that I see in the directory tree need to somehow be installed in MODx first.
            Right; my next step on Discuss is to create the build script that will allow you to just install it via Package Management. (And maybe create a developer’s version of the package as well).

            To get it operational in development mode before then, you’ll have to create all the Resources like such:


            Then create the snippets:


            Then in those snippets paste the code that refers to the actual snippet file (obviously changing the path to your SVN-checked-out path):


            And then create the system settings needed manually, including the Resource Map, which tells Discuss which pages to go to:


            Obviously, this is a tedious process for anyone wanting to see it live now. So, I suggest waiting until I finish the build scripts, and then it’ll be as simple as a one-click install, fill out some setup options, and then ready-to-go.

            Again, I’m assuming these settings would need to be applied *after* MODx was made aware of the existence of Discuss. So far, all I’ve been able to do is inspect the code and directory layout.
            Right; when I finish the build script, after you install Discuss, those settings will be configurable (at least in the development version of Discuss).

            Quote from: stephenrs

            What is the suggested iterative development/testing/debugging workflow, particularly with regard to snippets, chunks, and templates? ie, in what way should the docs be corrected to facilitate real-time development - is there a way to avoid duplicating code?

            It’s up to you, and depends on exactly *what* you’re making; if you don’t like coding in the MODx manager, then you can do a few things:

            - simply use PHP include calls in your snippets to refer to actual files on the FS. This is the most common way, and then when you’re done with your code in Revolution, you simply create a build script that grabs the contents of those files and puts them into Snippet objects, like so, so you can do dev work on them, but in other people’s installs they are in the actual snippets.

            - create a ’Request Handling’ class (see Quip’s manager request handler for an example of this) that will redirect requests based upon a REQUEST variable to different php files

            - run the MODx api externally and just do development from files

            To be honest, it really depends on what you’re developing.
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 28215
              • 4,149 Posts
              Quote from: stephenrs at Oct 15, 2009, 01:42 AM

              And a followup to the above question, in case the answers are different: What is the suggested development workflow for modifying 3PC’s - in the scenario where the code (chunk, snippet, or otherwise) of an existing component needs to be modified to suit a particular requirement.
              Well, hopefully the 3PC was written correctly so it’s extendable without modifications. But since that’s not always the case...

              Either:

              A) Duplicate the snippet/3pc and work on it directly
              B) Edit it directly and forego automatic upgradability
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 28215
                • 4,149 Posts
                Note to those of you reading this and trying to install Discuss - you’ll also have to add the rest of the system settings in the build script as well.

                I highly recommend just waiting till I finish the build scripts. But if you must, be warned it will take you some work to get it setup, since it hasnt even reached alpha-1. tongue
                  shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • Hello Shaun,

                  Concerning Discuss, will be be able to show post in a more common way? Like a "standard" forum?
                    • 28215
                    • 4,149 Posts
                    Quote from: lossendae at Oct 15, 2009, 05:35 PM

                    Concerning Discuss, will be be able to show post in a more common way? Like a "standard" forum?
                    Not at the moment, no. It is, however, in the plans. That said, it probably wont happen on the first public release of Discuss, but maybe later.


                    FYI: for those wanting a screencast of the latest Discuss: http://www.vimeo.com/7045942
                      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                      • 28494
                      • 32 Posts

                      - run the MODx api externally and just do development from files

                      This sounds like the most compelling option to me. Are there any examples or documentation which discusses how this is done? Are there drawbacks to this strategy? ie, do you lose out on any of MODx’s potential? Should I just leave this for now, and wait for Revo and its docs to get further along?


                      To be honest, it really depends on what you’re developing.

                      Can you elaborate on this, and perhaps describe some scenarios? Consistent with the theme of this thread - I’m wondering about the general workflow logistics of developing an application in MODx (whether it’s one snippet or 1000), without disrupting habits like version control and IDE use - particularly during early development where code changes are frequent. With the exception of building a 3PC for distribution (which is clearly not my orientation), it’s not clear to me how what one is developing would matter in the context of specific workflow.

                      The tip regarding testing outside MODx and then pasting code into the manager in the Revo docs was pretty specific with regard to suggested snippet development workflow. What would you suggest as a better tip to replace the one in the docs, and how would such a tip differ depending on what you’re building?



                      Well, hopefully the 3PC was written correctly so it’s extendable without modifications. But since that’s not always the case...

                      I’d argue that it’s very often not going to be the case, just based on my experience with the inherent limitations of "plug-and-play" website assemblage, which is perhaps limited. There seems to almost always be some little customization(s) that the site owner wants that the component developer didn’t anticipate...too many permutations to cover them all, even with pages and pages of properties...


                      Either:

                      A) Duplicate the snippet/3pc and work on it directly
                      B) Edit it directly and forego automatic upgradability

                      These are both viable *strategies* for approaching the modification an existing 3PC (although both would likely result in having to manually piece together an upgrade, depending on what was modified), but what I was asking about was *workflow*. For example, I’m using SPForm on my personal site, and the chunk to display the "thank you" message looks like this:

                         <div id="spf_response">
                         <h3>[[+spf-thank-you]]</h3>
                      
                         [[+spf-came-from]]
                      
                         [[+spf-back]]
                      
                         </div>
                      


                      I’m already using h3’s elsewhere in my site (and let’s assume I’m not willing to change the rest of my site to suit SPForm, or that my spf-thank-you note is longer than would be appropriate to put inside any Hn tag, semantically speaking), so regardless of the strategy I have selected, I assume my choices are:

                      1. Edit the chunk directly to contain the markup that I want
                      2. Create a new chunk with my preferred markup, then refer to it from the appropriate snippet
                      3. Any other choices?

                      In either case, I assume the workflow involves ultimately managing the HTML code from within the MODx manager, correct? Which, again, means version control is not an option for this bit of code, or is it? The other option I can envision is managing the chunk outside of MODx (under version control and via an IDE), and re-running the installer after every change. Is this the recommended workflow for packaged 3PC modification?

                      Still just trying to get a handle on how (or if) MODx can fit into an efficient, version controlled development workflow. I keep hearing that I can do this, but still mystified as to exactly how.