We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19909
    • 49 Posts
    Hello everyone,

    I am interested in learning how to develop a plugin for Revo - but am very lost at the moment with the abstraction that has taken place between Evo (modules) and Revo (CMP)

    Is there anywhere I can download an archive of a dummy plugin - one that would for example show the folder structure and core library calls to setup a custom manager page.

    The plugin I would like to develop is utilising some of the code from here http://www.splittingred.com/technology/2010/07/sending-email-in-revo-with-modmail.html#comments and expanding it into a system which would use a template for the newsletter structure and a database ( users can add themselves from frontend form ) which would be in the form of a grid list with checkboxes to determine who gets the newsletter - and also further down the line setting up categories to subscribe into (although it might be easiest to setup the table at the same time as building the core functionality) - so building an array of user data to pass to the mailing function.

    I am quite happy to have a go at creating something but just need some guidance/helping hand with the setup of the interface calls using modext etc etc

    Any information would be greatly received - splittingred wink .

    MM
      • 3749
      • 24,544 Posts
      Plugins in Revolution are pretty much like plugins in Evolution. It sounds like you need to know more about Custom Manager Pages, in which case this should help if you haven’t seen it already:

      http://svn.modxcms.com/docs/display/revolution20/Custom+Manager+Pages+Tutorial
        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
        • 19909
        • 49 Posts
        Thanks Bobray,

        I must admit to be extremely confused over the new abstraction layers that have been introduced - previously we had to cut and paste code into specific modules we had created - now we seem to need about 14 files before we start ! wink

        What I was basically asking for is a step-by-step guide from a very basic level - ie, I missed all the fun of the RC’s and have just jumped in at RC3 & PL versions of modxcms. The documentation seems to take a view that people already understand the concepts and structure required to begin development and there seems to be a lack of information about the core system calls (or maybe I haven’t found them). For example when I started developing for (ahem) wordpress the codex was all I ever needed - the information was clearly documented and for each command/system call there is a profound amount of information. I appreciate the time this takes but I think that it would massively enhance modx revolutions plugin development if the documentation was more fulfilling laugh

        I accept that maybe it’s me but from my point of view I was able to jump into Evolution development with a thought and although the code was never committed to the system between myself and the original author the Advertising Management plugin developed hugely in the time we worked on it adding multiple catagories, specific access via dates, tabbed and sortable interface for management, etc etc. I may yet resurrect it as the original author has indeed moved to develop for concrete5 he tells me, and may move back to Evo.

        I can see that revolution has much more power under the hood, its just I can’t find the accelerator !!

        Sorry this sounds like a rant but I feel it will help the community massively if the doc’s take a slightly lower starting point for the ’noobs’ to revo’s structure

        Regards,

        mm
          • 19909
          • 49 Posts
          For a step by step guide - I think I may have found something here:

          http://svn.modxcms.com/docs/pages/viewrecentblogposts.action?key=~splittingred

          Regards,

          MM
            • 3749
            • 24,544 Posts
            Quote from: mmuller at Jul 31, 2010, 12:16 PM

            Thanks Bobray,

            I must admit to be extremely confused over the new abstraction layers that have been introduced - previously we had to cut and paste code into specific modules we had created - now we seem to need about 14 files before we start ! wink

            I accept that maybe it’s me but from my point of view I was able to jump into Evolution development with a thought and although the code was never committed to the system between myself and the original author the Advertising Management plugin developed hugely in the time we worked on it adding multiple catagories, specific access via dates, tabbed and sortable interface for management, etc etc. I may yet resurrect it as the original author has indeed moved to develop for concrete5 he tells me, and may move back to Evo.

            Tell me about it. I have to explain it. wink

            Not a rant at all. It’s important for us to get feedback like this from users. Frankly, I’ve created a simple CMP, but all it does is show some HTML with links to its various pages so I can’t help you with a page that interacts with users in any interesting ways.

            Docs produced by the creators of a CMS are almost always cryptic for average users at first, but they improve over time as a result of feedback from those users. Often, the best docs start out as tutorials created by people who have just figured it out (usually, with a fair amount of effort and frustration and a lot of questions on the forum about how to perform each step).

            You might find this helpful as well, It shows how to add a form to a Manager page and process it. I think a CMP would handle things in a similar way: http://svn.modxcms.com/docs/display/revolution20/Adding+Custom+Fields+to+Manager+Forms. It’s very simple to implement and not too difficult to understand what’s happening. If you look at it, and at a controller file like manager/controllers/default/resource/update.php, where the System Events are invoked as part of the process, you can get a sense of what’s going on.
              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
              • 19909
              • 49 Posts
              Thanks again Bob,

              Frustration, nah! Just a sense of overwhelming stupidity at not being able to work out those cryptic messages... Because the lightbulb moment is always worth it - I have been reading through splittingred’s code for CMP’s and it is really quite easy to understand the page building part - what I fail to ’get’ is the actual basic folder/plugin structure as the post I mentioned above is almost there but then whilst reading it - the revolution version changed and then so did all the structure’s smiley So whilst in the first part of the tutorial I had an assets/myplugin folder (simple) by the third or fourth part a new build was released and the whole MVC thing had kicked in and obviously to you guys a paradigm shift of how the plugins would manifest themselves occurred and the tutorial mentions assets/components/myplugin/ <- various subfolders and then on the flip core/components/myplugin <- various subfolders...

              So here I am at the end of the first or second part with a single folder to find the method changed ( damn you ! wink ) and now I need to look at the whole code thing again ?!

              LOL... the fun is in there somewhere, my wife just wonders why I sit there reading for hours then I show her the code and she just thinks my new career choice is just plain weird!

              Regards,

              MM
                • 20413
                • 2,877 Posts
                Reading Patterns of Enterprise Application Architecture by Martin Fowler makes it easier to _justify_ the reasons to why learning all of this. grin

                I’m in the same boat. So many files!!!

                http://svn.modxcms.com/docs/display/xPDO20/Design+Patterns

                //using CHMViewer on my ipod touch to read it is great
                  @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
                  • 5340
                  • 1,624 Posts
                  Quote from: mrhaw at Jul 31, 2010, 06:12 PM

                  Reading Patterns of Enterprise Application Architecture by Martin Fowler makes it easier to _justify_ the reasons to why learning all of this. grin

                  I’m in the same boat. So many files!!!

                  http://svn.modxcms.com/docs/display/xPDO20/Design+Patterns

                  //using CHMViewer on my ipod touch to read it is great


                  Thanks for the book. Looks interesting.
                    • 3749
                    • 24,544 Posts
                    Kindle edition: $47.99 (Ouch!).
                      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
                      • 19909
                      • 49 Posts
                      Quick question,

                      My plugin needs to use multiple related tables

                      modx_mmSubscribers
                      modx_mmNewsletters
                      modx_mmSubscribedTo

                      - do I need to create multiple xml schemas? This doesn’t appear in any documentation that I have read and is confusing the hell out of me because if I create multiple schemas do I need to also create multiple models? I’ll have a ton of models/classes etc etc

                      Or do I create multiple objects within a single schema ? for example:
                      <model package="mmNewsletters" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM"
                           phpdoc-package="mmNewsletters" phpdoc-subpackage="">
                      
                          <object class="mmSubscribers" table="mmSubscribers" extends="xPDOSimpleObject">
                              <field key="id" dbtype="int" precision="10" phptype="string" null="false" default="" />
                              <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
                      	<field key="email" dbtype="varchar" precision="255" null="false" default="" />
                      </object>
                          <object class="mmNewsletters" table="mmNewsletters" extends="xPDOSimpleObject">
                              <field key="id" dbtype="int" precision="10" phptype="string" null="false" default="" />
                              <field key="newsletter" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
                      	<field key="template" dbtype="varchar" precision="255" null="false" default="" />
                      </object>
                          <object class="mmSubscribedTo" table="mmSubscribedTo" extends="xPDOSimpleObject">
                              <field key="id" dbtype="int" precision="10" phptype="string" null="false" default="" />
                              <field key="subscriberID" dbtype="int" precision="10" phptype="string" null="false" default="" />
                              <field key="newsletterID" dbtype="int" precision="10" phptype="string" null="false" default="" />
                      </object>
                      


                      And then the model would contain all the necessary access to each class ? and thus allow me to build the correct database calls and queries between them ?

                      Also can someone decipher the following:

                      // you'll want to change this first line to point to the actual MODx install path  
                      define('MODX_BASE_PATH', dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . '/MODx 0.9.7/');  
                      


                      Does one remove the dirname(dirname( etc etc and fill it with the physical path to my modx install ie /users/digbookpro/sites/ or just the part in the quotes ?

                      These are the simple things that make the tutorials easy to follow or completely mindbending - I am willing to play but I put this here as the information isn’t clear...


                      Regards,

                      MM