We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25663 MODX Staff
    • 12,272 Posts
    The next step is to do a basic writeup of those concepts ... kinda one-liner descriptions. REMs are kinda tricky but really easy at the same time... more soon.

    Never trust me typing, either. tongue
      Ryan Thrash, MODX Co-Founder
      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: garryn at Jul 13, 2006, 04:33 PM

      One question about the overview and the roadmap: Which part of the roadmap covers the resource element maps? I’ve been looking over bits of the new core to get a feel for it and want to make sure I can place all the different elements.

      A modResourceElement map is simply how modElements are attached to modResources explicitly, in much the same way as Template Variables are attached to Templates today. So, what is being conveyed in the diagram is the loose coupling between Resources and Elements, where the Base Template is used to explicitly attach a Template element to a Resource, the processing of which may include parsing additional Elements represented by tags in the content, and/or resource element maps, which are the logical extension of Template Variables, allowing additional Elements to be directly related to/customized for a Resource. Most elements can also define dependent elements that can act in much the same way as Resource Element maps, so when assigned to a Resource as a Base Template (or Element of any type), the traditional Template Variable scenario is covered. Just to help connect the dots a little further, consider that a Context can then isolate specific Resources and/or Elements to certain sections of your site, and I think you’ll start to see how this will allow all sorts of new possibilities without sacrificing the existing MODx approaches.

      And don’t forget that you can write your own Element class derivatives by simply implementing a single process() function, overriding the behavior or replacing it completely.

      For instance, the modSnippet is a derivative of the modElement class which defines all the functionality needed to process a PHP code snippet via a MODx tag (e.g. [[ScriptElement]]); so to implement the current functionality of MODx plugins, I created the PluginElement class that consists of simply:

      <?php
      class modPlugin extends modSnippet {
          function modPlugin(& $xpdo) {
              $this->__construct($xpdo);
          }
          function __construct(& $xpdo) {
              parent :: __construct($xpdo);
              $this->set('class_key', 'modPlugin');
          }
      
          function process($properties= null, $content= null, $cultureId= null) {
              $this->output= parent :: process($properties, $content, $cultureId);
              echo $this->output;
              return $this->result;
          }
      }
      ?>


      That’s how easy it will be to create your own Element classes to do just about anything you can imagine, including just slightly altering the behavior of an existing Element implementation.

      NOTE: The dual constructors you see are part of the code generated by XPDO, and is used only to help bridge the gaps in PHP 4 and PHP 5 object behavior, specifically to allow PHP 4 to always fall through to the PHP 5 style constructor, as well as allow PHP 4 to call the parent constructor without having to know the actual name of the parent class.
        • 25663 MODX Staff
        • 12,272 Posts
        Whaoh... what a sentence:
        So, what is being conveyed in the diagram is the loose coupling between Resources and Elements, where the Base Template is used to explicitly attach a Template element to a Resource, the processing of which may include parsing additional Elements represented by tags in the content, and/or resource element maps, which are the logical extension of Template Variables, allowing additional Elements to be directly related to/customized for a Resource.

        What he meant to say (in my overly simplified view of the world tongue) is think about a "new catalog page" button ... or New Blog Page or New Gallery or New Member Form ...

        Basically it’s a way to have custom Document pages in the MODx manager by grouping all the different elements together.

        Most elements can also define dependent elements that can act in much the same way as Resource Element maps, so when assigned to a Resource as a Base Template (or Element of any type), the traditional Template Variable scenario is covered.
        Everything is basically a custom content field (or TV in todays lingo). Also, everything, including the metadata like today’s pagetitle, longtitle, etc. are the same. So that means everything gets the same capabilities of TVs including the @binding functionality.

        Just to help connect the dots a little further, consider that a Context can then isolate specific Resources and/or Elements to certain sections of your site, and I think you’ll start to see how this will allow all sorts of new possibilities without sacrificing the existing MODx approaches.
        IOW, you can build sites exactly like you do today, even using the same exact tags if you want. It pretty much should all work. However, you can also do things like subdomains or multiple sites all under the same install. Or have a person ONLY be able to edit JUST their pages they’ve created (think MySpace-like stuff).

        And don’t forget that you can write your own Element class derivatives by simply implementing a single process() function, overriding the behavior or replacing it completely.
        Don’t like the way something works? Get a dev-head to rewrite it the way you think it should work. The good part is that you don’t have to worry about upgrades because it’s just extending/overriding the default stuff, not a hacked replacement thereof. Hello virtually seamless upgrade process to a highly customized solution! laugh

          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 25663 MODX Staff
          • 12,272 Posts
          Basically it’s a way to have custom Document pages in the MODx manager by grouping all the different elements together.

          And to quote myself, that "basically" is very literal and just barely brushes the surface ... it gets a lot more deep than that, but don’t worry about it for now. Baby steps.

          Think TVs when you first ran into them. wink
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 25663 MODX Staff
            • 12,272 Posts
            And now it’s available to the entire team. Please don’t reference this in the public forums yet. Thanks!
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 6726
              • 7,075 Posts
              Quote from: rthrash at Jul 17, 2006, 04:11 PM
              Please don’t reference this in the public forums yet. Thanks!

              Duly noted Ryan.

              Quite an interresting read grin (And thanks Ryan for the "translation" of some harder concepts : certainly helped me) !

              The architecture diagram is pretty handy, and the roadmap doc is most enlightening and might I say again, truly exciting !!! I’ll have to re-read that again... but to sum it up it’s like the answer to all prayers and request I have seen here and there on the forums...

              Since I am not half as qualified as you guys are to make an assessment, would I be wrong thinking this (1.0 / Tattoo release) will be a major event on the content management scene/market ?). Reading the features outlined in the roadmap and what they’d potentially mean for webdesigner I can’t help thinking that it will...
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l&#39;outil id
                • 7923
                • 4,213 Posts
                Now that I got an access to here too, I’d just like to post "WOW!!" after reading all this.. I have read Jason’s post around the forums about 1.0 previously, but this makes me to see the bigger picture. And thank you too Ryan for the more "down-to-earth" type of explanations, very usefull indeed. Great work guys altogether! Looking forward to see the official version of the RoadMap soon... smiley


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."