We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28494
    • 32 Posts
    A little context: I’m a long time developer, well versed in MVC, etc, and have used 3 other popular frameworks in the past on large projects (CakePHP, Zend, and Symfony)...

    Now I’m building a personal site which will need to pull almost all of its document content via AJAX. For example, most of the content will load into jQuery tabs. I’d like to use Modx on this site as a way to get more familiar with it, to potentially add it to my arsenal of tools - but I’m having trouble getting my head fully around some of the concepts. Also, I’m starting my Modx journey using Revolution beta3.

    In particular, I’ve had trouble finding working examples or documentation to guide me in how it is intended that my app be structured, both in terms of directory layout and file(s) contents - the Modx way.

    Also, I know that using snippets is the recommended way to inject PHP into an app - and I can appreciate the power of snippets, but the idea of having code floating around not under version control (and not easily centrally maintained directly in my IDE) hurts my brain (and my workflow). So, I prefer to have all of my PHP code in external files, and my content managed by Modx.

    If anyone can provide some guidance (commentary, links, etc) I would be very appreciative. Also, if wanting to use external files exclusively for code defeats the purpose of using Modx in the first place, then I’d also appreciate it if someone would tell me if I’m just barking up the wrong tree.

    A tiny example of clicking a link to load a Modx document into a div would go a long way for me right now. Throw in some jquery to make it really fit my situation, and I will bow down in gratitude.

    Thanks.
      • 20413
      • 2,877 Posts
      One snippet to run them all (extra benefit: way smaller cache file - siteCache.idx.php!)
      http://modxcms.com/forums/index.php/topic,18872.msg161906.html#msg161906

      Ajax
      http://modxcms.com/forums/index.php/topic,37438.msg225891.html#msg225891
      http://wiki.modxcms.com/index.php/Use_AJAX_with_modxAPI -I haven’t tried this

      //Sorry! My answer was for Evolution!! rolleyes
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
      • Hello Stephenrs,

        I don’t think you have to change your method of work if you’re not going to release anything public (and even in this case, there are no default behaviour, just good practice from the core developper).

        Here is a link where you can find documentations for MODx Revolution.

        Note that you can use your own version control in your IDE, snippets can include any file and can contain only an include if necessary.

          • 28494
          • 32 Posts
          Thanks for the replies, but from what I can tell so far, either:

          1. Revolution (and the docs) are not ready for prime time (I know, it’s still in beta), even on a small personal project - or
          2. I’m being incredibly thick headed and missing something fundamental, because the replies were confusing - or
          3. Modx is just not for me

          I’m also confused as to why this thread was moved to the Evolution 1 forum (or was it just cross-posted?). I was asking a question about Revolution beta3...or are they essentially the same when it comes to extending with custom PHP???

          I had already figured out how to use a one-line snippet to avoid having to maintain my template file inside the Modx manager, but the idea of doing that with all the scripts in my app (as suggested by one of the links above) is just not at all appealing to me. This feels very workaround-ish, and would make for a pretty brittle architecture as far as app maintenance goes, and I also have doubts about what this might mean for performance. It also means I’d essentially be jumping through hoops to get the CMS/framework "out of the way" so I can write code. I’m also just not sure that keeping code in a DB is ever a good idea for a complex app. And the lack of coherent example applications and tutorials also doesn’t help convince me otherwise.

          I can see how designer types or newer developers might like this kind of thing – and that’s fine, there’s a place in the world for that, but I’ve just found that the more professional developer-focused frameworks are simply more liberating than the Modx world. Just my opinion. If you think snippets and chunks are cool, you should check out what symfony (and others) can do (with things like "partials" and "helpers") for your development productivity and app sustainability - I’m consistently amazed. The learning curve is steeper, but it’s worth it. I don’t mean to start a flame war here, or to draw folks away from Modx, just expressing my experience - choose what suits you and your projects.

          I also have to say that I’m a little disappointed. I looked briefly at Modx almost 2 years ago after working extensively with Mambo/Joomla and Drupal, and I remember thinking "wow, somebody is finally building a Content Management System that actually focuses on managing content well, and not on trying to be all things to all people”. It seems that things have taken a turn for Modx...it now feels like a more modern, smarter version of the other "CMS" beasts...again, just my opinion. I think I “get it” conceptually at this point, but I think I’d rather see a CMS that makes *less* assumptions about how people like to write/maintain code, and separates the the content management functionality from the coding framework – playing the role of a CMS literally, rather than acting as the central arbiter for everything that happens in a web app. And over the last year a few have surfaced.

          Maybe another project will come along and I’ll have an ahah moment about using Modx, but for now I think I’ll stick with another framework for my little project.

          I’m always willing to be convinced if I’m just missing something here...somebody, please make me eat my words...
          • Quote from: stephenrs at Sep 29, 2009, 04:52 PM

            1. Revolution (and the docs) are not ready for prime time (I know, it’s still in beta), even on a small personal project - or
            2. I’m being incredibly thick headed and missing something fundamental, because the replies were confusing - or
            3. Modx is just not for me
            I think 2, but I’m biased as a core developer. wink I truly do want to engage you in this conversation, as it is central to our adoption issues. IMO, we’re in a catch-22 where we need more developers to "see the light" in order to make life for designers and end-users more productive without having to be a jack-of-all-trades.

            Quote from: stephenrs at Sep 29, 2009, 04:52 PM

            I’m also confused as to why this thread was moved to the Evolution 1 forum (or was it just cross-posted?). I was asking a question about Revolution beta3...or are they essentially the same when it comes to extending with custom PHP???
            I was confused as well; and that’s why I moved it back to a Revolution board.

            Quote from: stephenrs at Sep 29, 2009, 04:52 PM

            I had already figured out how to use a one-line snippet to avoid having to maintain my template file inside the Modx manager, but the idea of doing that with all the scripts in my app (as suggested by one of the links above) is just not at all appealing to me. This feels very workaround-ish, and would make for a pretty brittle architecture as far as app maintenance goes, and I also have doubts about what this might mean for performance. It also means I’d essentially be jumping through hoops to get the CMS/framework "out of the way" so I can write code. I’m also just not sure that keeping code in a DB is ever a good idea for a complex app. And the lack of coherent example applications and tutorials also doesn’t help convince me otherwise.

            I can see how designer types or newer developers might like this kind of thing – and that’s fine, there’s a place in the world for that, but I’ve just found that the more professional developer-focused frameworks are simply more liberating than the Modx world. Just my opinion. If you think snippets and chunks are cool, you should check out what symfony (and others) can do (with things like "partials" and "helpers") for your development productivity and app sustainability - I’m consistently amazed. The learning curve is steeper, but it’s worth it. I don’t mean to start a flame war here, or to draw folks away from Modx, just expressing my experience - choose what suits you and your projects.

            I also have to say that I’m a little disappointed. I looked briefly at Modx almost 2 years ago after working extensively with Mambo/Joomla and Drupal, and I remember thinking "wow, somebody is finally building a Content Management System that actually focuses on managing content well, and not on trying to be all things to all people”. It seems that things have taken a turn for Modx...it now feels like a more modern, smarter version of the other "CMS" beasts...again, just my opinion. I think I “get it” conceptually at this point, but I think I’d rather see a CMS that makes *less* assumptions about how people like to write/maintain code, and separates the the content management functionality from the coding framework – playing the role of a CMS literally, rather than acting as the central arbiter for everything that happens in a web app. And over the last year a few have surfaced.
            We make no assumptions about how to write/maintain code, but provide similar ideas to partials/helpers; maybe they are hoops, but I don’t see them that way. The key is in separation of presentation and logic, decoupling if you will, and that’s what makes MODx completely different than the other beasts IMO. The problem is, developers continue to not properly separate these things and the contributions reflect poorly on the vision of keeping them separated. We need more developers to participate here and create generic solutions that reflect this vision to change the perception and that is tough to do with so many PHP CMS and framework options out there. The only thing that has to be coupled with the CMS is how you present output from your components, and even this is extremely flexible in MODx. Everything else is wide-open, and the real difference is going to be (IMO) in package management, where the API allows scripting control over how things are installed, upgraded, etc., be it content, code, or custom data objects.

            IMO, this is the most difficult issue for CMS systems to tackle. There is always an intimate relationship between presentation and logic, and how to de-couple those without making the developer’s role or the designer’s role impractical is the challenge; one we’re trying to tackle head on here. I don’t think the existing CMS beasts as you call them, or pure development frameworks like Symfony are able to address this in the same way, but I may be wrong too, as I’ve been immersed in the MODx world for many years now. I’d love to hear more details of how these "partials" and "helpers" work in fact, if for no other reason than as a reality check.

            Quote from: stephenrs at Sep 29, 2009, 04:52 PM

            Maybe another project will come along and I’ll have an ahah moment about using Modx, but for now I think I’ll stick with another framework for my little project.

            I’m always willing to be convinced if I’m just missing something here...somebody, please make me eat my words...
            I’m not sure I can convince you, but I hope engaging in this conversation will at least better enlighten each of us to important issues in the current state of web development and design practices.

            Now back to your original questions:
            Quote from: stephenrs at Sep 29, 2009, 12:53 AM

            A little context: I’m a long time developer, well versed in MVC, etc, and have used 3 other popular frameworks in the past on large projects (CakePHP, Zend, and Symfony)...

            Now I’m building a personal site which will need to pull almost all of its document content via AJAX. For example, most of the content will load into jQuery tabs. I’d like to use Modx on this site as a way to get more familiar with it, to potentially add it to my arsenal of tools - but I’m having trouble getting my head fully around some of the concepts. Also, I’m starting my Modx journey using Revolution beta3.

            In particular, I’ve had trouble finding working examples or documentation to guide me in how it is intended that my app be structured, both in terms of directory layout and file(s) contents - the Modx way.

            Also, I know that using snippets is the recommended way to inject PHP into an app - and I can appreciate the power of snippets, but the idea of having code floating around not under version control (and not easily centrally maintained directly in my IDE) hurts my brain (and my workflow). So, I prefer to have all of my PHP code in external files, and my content managed by Modx.
            This is certainly a valid issue, but we manage all of our code in SVN, then use transport packages to prepare it and install/upgrade it into an ongoing site/project. Most of our snippets are simply file includes that bring in classes or files containing the code needed to perform a specific task, along with configuration properties that can be controlled by a site designer or end-user, so that is not an issue.

            Quote from: stephenrs at Sep 29, 2009, 12:53 AM

            If anyone can provide some guidance (commentary, links, etc) I would be very appreciative. Also, if wanting to use external files exclusively for code defeats the purpose of using Modx in the first place, then I’d also appreciate it if someone would tell me if I’m just barking up the wrong tree.

            A tiny example of clicking a link to load a Modx document into a div would go a long way for me right now. Throw in some jquery to make it really fit my situation, and I will bow down in gratitude.

            Thanks.
            We can make this example happen, and to be honest, it is trivial in MODx to do this. I don’t have the bandwidth to produce the example for you at this exact moment, but will try tonight to provide more concrete information for you.

            In the meantime, have you checked out the "More Resources" section at http://svn.modxcms.com/docs/display/revolution/ ?
              • 28215
              • 4,149 Posts
              Quote from: stephenrs at Sep 29, 2009, 12:53 AM

              In particular, I’ve had trouble finding working examples or documentation to guide me in how it is intended that my app be structured, both in terms of directory layout and file(s) contents - the Modx way.

              Also, I know that using snippets is the recommended way to inject PHP into an app - and I can appreciate the power of snippets, but the idea of having code floating around not under version control (and not easily centrally maintained directly in my IDE) hurts my brain (and my workflow). So, I prefer to have all of my PHP code in external files, and my content managed by Modx.
              Our "Best Practices" documentation is a bit lacking currently, but here’s a tutorial that might be applicable:
              http://svn.modxcms.com/docs/display/revolution/Using+Custom+Database+Tables+in+your+3rd+Party+Components

              Let’s say your project is named ’Boo’.

              If you want to manage your files via SVN, I recommend putting all of your files into an Eclipse project (or some directory outside of /modx/ (so you can SVN modx as well), then creating snippets that just "include" the files.

              Then you can use $modx->toPlaceholders (see the API here for other similar methods) and such to assign variables to the Resource that you are placing the Snippet call in.

              Say I have a snippet that assigns the placeholder "welcome" to "Welcome Johnny!" via this code:

              $modx->setPlaceholder('welcome','Welcome Johnny');
              


              I then in my Resource put this:

              <p>[[+welcome]]</p>
              

              (obviously you can omit the p tags) And i’m done. So as you can see, you can get really flexible with your content with placeholders.


              If anyone can provide some guidance (commentary, links, etc) I would be very appreciative. Also, if wanting to use external files exclusively for code defeats the purpose of using Modx in the first place, then I’d also appreciate it if someone would tell me if I’m just barking up the wrong tree.
              Nah, it doesn’t. MODx can be whatever you want it to be. Our Extras section is managed by snippets including external files, installed via Transport Packages, that allow us to manage the code via SVN.

              A tiny example of clicking a link to load a Modx document into a div would go a long way for me right now. Throw in some jquery to make it really fit my situation, and I will bow down in gratitude.

              Well, that’s pretty easy. Just set your Documents you want to load via AJAX with a blank (or minimal) template, then call the page directly via AJAX. The code would look something like this (pulled from jquery UI’s docs:

              <script type="text/javascript">
              $(function() { $("#tabs").tabs(); });
              </script>
              
              <div id="tabs">
              	<ul>
              		<li><a href="[[~92]]">Resource with ID 92</a></li>
              		<li><a href="[[~546]]">Resource with ID 546</a></li>
              		<li><a href="[[~123]]">Resource with ID 123</a></li>
              	</ul>
              </div>
              


              Note that all you’re doing is pointing the href tags to the actual document IDs, just like a normal link. The trick is you’re making your Template for the Documents be blank (or minimal) so that it only loads the parsed content itself.
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 28494
                • 32 Posts
                Thanks much for the thoughtful (and quick) replies. I’m pressed with other work at the moment, but will come back to this thread as soon as I have a little more breathing room.
                  • 28215
                  • 4,149 Posts
                  Something I thought - if you want those tabs to have their titles to be the pagetitle of the resource itself, you could create a snippet called ’getResourceField’ that grabs the pagetitle for a specified resource:

                  <?php
                  /**
                   * Grabs a field for a specified Resource
                   */
                  /* setup some default properties */
                  $id = $modx->getOption('id',$scriptProperties,false);
                  $field = $modx->getOption('field',$scriptProperties,'pagetitle');
                  
                  if ($id) { /* grab the resource object */
                      $resource = $modx->getObject('modResource',$id);
                      if ($resource == null) return '';
                  } else { /* if no id specified, use current doc */
                      $resource =& $modx->resource;
                  }
                  
                  /* return the field value */
                  return $resource->get($field);
                  ?>
                  


                  And then in your LI tags in the example above:

                  <li><a href="[[~92]]">[[getResourceField? &id=`92` &field=`pagetitle`]]</a></li>
                  


                  The Snippet is a bit more more complex than probably you need it (you could technically do the Snippet in one line, but this one allows for default values). But it’ll work.
                    shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                    • 28494
                    • 32 Posts
                    Warning: very long post below, I don’t know what got into me. Jason, be careful what you wish for when inviting someone to engage in a discussion wink


                    I think 2, but I’m biased as a core developer. Wink I truly do want to engage you in this conversation, as it is central to our adoption issues. IMO, we’re in a catch-22 where we need more developers to "see the light" in order to make life for designers and end-users more productive without having to be a jack-of-all-trades.

                    I think it turns out that actually it’s a combination of a bit of all 3. In the end though, it would seem to depend on what you want Modx to be, and to whom. For example, if you want to give folks who are building content focused web SITES a better way (compared to some of the alternatives) to sprinkle in programmatic customizations - with a strong designer bias, then you’re on the right track. But – I think if you want to convince developers who are building (perhaps larger scale) web APPLICATIONS with some content sprinkled in to use Modx, then you have some work to do.

                    Interestingly, I found this blurb from smashingred in the comments on this page: http://www.devtrench.com/things-that-suck-about-modx-cms (sorry about the title, but the author, in truth, loves Modx): “You will also see the erroneous use of MODx being labelled as an Application Framework disappear when the new site is up (month or 3 from now) and all the documentation will clarify this and more.”

                    Also from the body of that article: “I just don’t see the structure there to really call it a framework, and I would prefer to call it a CMS with an open or pluggable architecture”.

                    I tend to strongly agree with both of these comments, but it looks like you guys have decided to stick with the application framework label. My opinion is that the label just doesn’t fit (today), compared to almost any of the true application frameworks out there – and people who understand what a framework can be, aren’t ultimately going to be fooled. From what I can tell, the current MODx platform just doesn’t scale well from an application sustainability and maintainability point of view, and it falls well short of providing the types of tools that framework users have come to expect (eg, command line utilities, choice of ORM, scaffolding, etc).



                    We make no assumptions about how to write/maintain code, but provide similar ideas to partials/helpers; maybe they are hoops, but I don’t see them that way. The key is in separation of presentation and logic, decoupling if you will, and that’s what makes MODx completely different than the other beasts IMO. The problem is, developers continue to not properly separate these things and the contributions reflect poorly on the vision of keeping them separated. We need more developers to participate here and create generic solutions that reflect this vision to change the perception and that is tough to do with so many PHP CMS and framework options out there. The only thing that has to be coupled with the CMS is how you present output from your components, and even this is extremely flexible in MODx. Everything else is wide-open, and the real difference is going to be (IMO) in package management, where the API allows scripting control over how things are installed, upgraded, etc., be it content, code, or custom data objects.

                    Standardization and Documentation

                    Conceptually we agree (as most of the development community does) that separation of presentation and logic is a good thing. Where we seem to disagree is in how to not only implement this well, but how to do so in a way that encourages others to adopt the same currently accepted best practices which are in line with your vision.

                    It’s perhaps the "wide-open"ness of MODx that is one of my concerns about the platform. The current system encourages an almost freestyle approach to building apps - this tells me something about the quality of add-ons, etc that I can expect (and have observed). This architecture helps designers and users (and budding developers) get more involved in the process, but when folks can freestyle their code, the result is usually not something you can expect to easily and cleanly build upon or reuse, as you alluded to. It’s human (developer?) nature - provide little structure or guidance for coding on a platform, then people will do it poorly. And going from one contribution to the next will always be like starting from scratch, because there is no standardization. This is one of the reasons I’ve mostly moved away from other CMS (beast) communities, and toward the deeper frameworks. There is little comparison between the quality and reusability of the code that emanates from these very different camps.

                    It’s good to also keep in mind that every framework that’s worth the bytes it’s sitting on allows you to do things in whatever way you want (MODx is not the first) - BUT - the really good ones first tell you how the framework is intended to be used, if you’re planning to comply with the authors’ suggested best practices - AND - they provide well thought out, complete examples. So, these problems can partially be traced back to the documentation.

                    We all know how difficult it is to write documentation and keep it up to date, but no matter how good your intentions are, if you don’t communicate them clearly, you’re unlikely to get as many people on-board as you hope. Two of the best collections of documentation are for Symfony and for jQuery (CakePHP’s are pretty good too). Full of examples and suggested best practices, and written for someone who has never used the tools before. I’m sure I’m not telling you anything that you haven’t already heard, but speaking candidly, not only are MODx’s docs sparse (I’m perhaps unfairly referring to Revolution), but the language often assumes a level of familiarity with MODx concepts that most new users just won’t have.

                    I’ve read the docs, blog tutorials, forum postings, and picked apart some add-ons (including SPForm), and I’m still confused about how it’s intended that my app be set up. Tpl files, connectors, processors, chunks, snippets, i18n files...how is this all supposed to be set up (according to the vision)? How do the pieces fit into the MVC pattern? Where do I put my custom (or vendor) classes? Is something going to autoload them? Can I manipulate the ORM if I need to optimize my join queries? Can I load only the parts/classes of the framework that I know I need? Are all questions that left unanswered will make it difficult for anyone building more than a content site with a few cool features to adopt MODx.

                    Design Philosophy and Code Maintenance

                    Perhaps maybe the biggest and most problematic assumption MODx makes about how to write/maintain code though, is that developers would ever want critical business logic to be stored in (or dependent on) the db of a CMS - except in special circumstances.

                    Whether we’re talking about snippets or pseudo snippets which only do includes (which, to me, is a hack - not a documented part of the system design), the result is the same. Given the extra work and problems that this introduces for developers who use IDEs and version control (as just 2 examples of potential problems), it begs the question: why does any code/business logic *need* to be in the db in MODx? ie, what design goal is this satisfying? Is there some performance or other benefit to storing snippets in the db? Shouldn’t a best practice oriented framework encourage the best practice of keeping code under version control by making it easy, rather than forcing extra steps - and actually making it easier to avoid this best practice?

                    Why not let the snippet editor in the MODx manager simply edit files on the file system, so developers have a legitimate choice of how to maintain them? The more I think about it, the more strange it seems that by its very design MODx is suggesting that I dump my IDE to write code in a text area – for many people this is a very strange notion...or have to build/maintain something called a transport package just so I can keep my IDE...it’s just a little upside down...Although I’m guessing maybe I’m still missing something about your intentions where this is concerned...

                    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

                    Another example is forcing developers to use only HTML in chunks and PHP in snippets. Why? I think I appreciate what you’re trying to achieve here, but shouldn’t developers have a choice for what kind of code goes in views vs controllers?

                    So, while MODx succeeds in decoupling some application layers when compared to those other beasts, it introduces tight coupling in the areas of workflow and application structure - and I’m finding this particular tight coupling unnatural and uncomfortable...and limitations not found in other true frameworks.

                    I think the nature of this problem potentially rests in our fundamentally differing views of what a CMS should be, and whether or not there should be a line drawn between a CMS and an application framework architecturally.

                    Generally speaking, It seems to me that a CMS is just a fancy name for an application for performing CRUD operations on content objects. All the other objects in my application should sit next to (not under) the content CRUD module – and I should be able to choose how I want that application to work: freestyle, framework-based, or other. A useful CMS would provide nice API hooks so that my other application objects can interact with content programmatically, while designers and users have an easy intuitive interface for interacting with those objects – and that’s where the CMS’s job ends.

                    So, one of the underlying problems for me is that MODx is starting to remind me of those infamous beasts by taking the position that “the CMS is the thing” and everything that happens in an app has to talk through the layers of the CMS (and MODx even goes further by helping me keep my code in the CMS), rather than just letting it be the CRUD module that it really is. As MODx continues to grow in this direction, I worry that it will become just another beast – and never a framework. Remember, leading up to the time of the initial 1.5 overhaul release, people started calling Joomla a framework too...it’s still not. In my humble opinion, hammering on a CMS to make it into a framework is a bit misguided from the start.

                    Hope it’s not inappropriate to discuss other perhaps competing projects here, but this seems to be a good example. I haven’t gotten past the home page of the Silverstripe.org project yet, but I see that they’ve packaged the CMS and the framework separately. This immediately makes much more sense to me as a starting point, from an architecture point of view.


                    IMO, this is the most difficult issue for CMS systems to tackle. There is always an intimate relationship between presentation and logic, and how to de-couple those without making the developer’s role or the designer’s role impractical is the challenge; one we’re trying to tackle head on here. I don’t think the existing CMS beasts as you call them, or pure development frameworks like Symfony are able to address this in the same way, but I may be wrong too, as I’ve been immersed in the MODx world for many years now. I’d love to hear more details of how these "partials" and "helpers" work in fact, if for no other reason than as a reality check.

                    Some of the PHP frameworks have been implementing MVC well for a long time now (Symfony among them), and I personally am a serious devotee to the pattern – so, separating presentation from business logic is a problem that has already been solved by the collective mind – so I tend to disagree here. Further, setting things up so that designers can focus on design and not code is something that things like Smarty templates and others already do pretty well – but this has little or nothing to do with a framework – it’s a thin sliver of the the view layer that the underlying application framework should be fairly, if not completely agnostic to – much less exerting control over.

                    While the frameworks already do an excellent job for pure application development, they have traditionally fallen short in the area of Content Management. It’s been mostly up to developers to roll their own, or somehow integrate an existing system. It hasn’t been pretty, but fortunately some frameworks (eg, Symfony) will auto-generate clean, object oriented CRUD code from a data model (with a single command line command) – which saves hours/days of programming, and provides a nice starting point for a custom CMS with sound best practices already built in.

                    This has started to change in the last year or so with the maturation of a few CMS plugins for some of the frameworks...which sit on top of the framework along with your other modules, rather than the other way around. This also means that if you don’t like a CMS, you can swap in another one quite easily with low to no impact to your application logic.

                    I won’t go into detail about helpers/partials, except to say that partials are like chunks (but you’re free to put PHP code in them), and helpers are like snippets – to extend the view layer functionality (but you’re free to put HTML code in them). There’s plenty of other info on the net for the curious, including the Symfony docs. So I have to point out that the limitations you’ve placed on what kind of code can go where may not seem like limitations to you, but they are – especially to a developer who’s used to having total freedom.


                    This is certainly a valid issue, but we manage all of our code in SVN, then use transport packages to prepare it and install/upgrade it into an ongoing site/project. Most of our snippets are simply file includes that bring in classes or files containing the code needed to perform a specific task, along with configuration properties that can be controlled by a site designer or end-user, so that is not an issue.

                    One of the beauties of PHP itself is its simplicity with regard to dev environments - and I think it should stay that way. <?php echo ‘hello world’; ?> is a complete script – add a web server and a browser and you’re done. Transport packages sound more like something cooked up in a clustered java deployment environment for an enterprise application, than something for RAD-oriented PHP folks. They add complexity to the PHP dev process (and time, and extra work). And we all know that more complexity usually results in more problems somewhere along the way. They sound like they’d be great for deploying add-ons, or for maybe deploying apps to remote servers, but for day-to-day development, IMO they just sound like a pain - having a hard time finding the justification for these extras from an overall workflow point of view.

                    After all is said and done, I think it really does come back to where I started with this diatribe: just being clear and honest about what you want MODx to be and to whom. Right now, I respectfully think you’re not being honest with yourselves (or the public) by calling MODx a PHP Application Framework. It’s simply and quite objectively not, when held up against the other developer-focused frameworks – BUT – MODx kicks major butt for what it IS – a pluggable, easily extendable CMS (or website management system)...a better beast smiley

                    Like all tools, MODx, in its current incarnation, is great for a particular size and type of project and for users of a certain skill and experience level. It would seem wise to be clear and focused about that, and try to get as many people that fit the mold on board, rather than the “all things to all people” that it seems to be trying (or at least advertising) to be now.

                    I will say though, that after reading splittingred’s post above, it looks like I will actually be using MODx for the personal site I’m working on.

                    For now, my site only needs hooks into the CMS, and a nice UI for me to manage the content. I’ve already built the entire view layer (HTML, CSS, PHP, JS) with stubs for the actual content, and have been looking at candidates for the backend (and ways to enhance my knowledge of the current state of the art). He provided a perfect example (I’d vote for including it in the docs somewhere) to show me how easy it will be to plug my UI into the CMS part of MODx. Maybe I should have checked the older docs, but I found nowhere in the Revo docs any mention of how to retrieve content...

                    With all this said, if you’re serious about pursuing adoption from framework-savvy developers, then I’d recommend building something with Symfony (or CakePHP as my current second choice), and reading the docs – just to see how it all feels first hand. I think you’ll see what I mean. If I wanted to open an auto repair shop in my neighborhood...I better know what the inside of one looks like, no?

                    I hope this all didn’t sound too much like a rant. I get the feeling you spend a lot of time inside the MODx box, so I’m just hoping to give you some honest perspective about what it looks like from outside that box - at least from where I’m sitting...and maybe something I say here will inspire you to turn it around and teach me something about the possible errors of my ways.

                    Hope this provides some useful info, and didn’t bore you to tears or take up too much of your day...
                      • 28215
                      • 4,149 Posts
                      Stephen,

                      Thank you so much for your reply. I have much to reply to on it, and think you’re dead-on on some points. Some I will respectfully disagree with. But I wanted to let you know that I will be responding soon to this, and we at MODx greatly appreciate your thoughts (and hopefully eventual contributions! wink ).

                      -Shaun
                        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com