We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31783
    • 2 Posts
    Hi,
    I can write my own thing easaly in php, but never used modx. now someone asked me if i can make some things, i said yes, but then, the said she wants to use modx as she always does. my question: how simple is it,when i make a own php code, wich result in a html code, to include in the admin and display part of modx? it is easy to do? or do i realy have to dive deep in the php code of modx?
    thanks,
    Bart
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      There are a number of ways to include PHP code in MODx. For output on the final web page, you can use snippets or Template Variables with @EVAL binding. To modify the actual functionality of core MODx processes (such as during the parsing of resources and the generation of the page, or before or after a user logs in as just two examples) we have "plugins" that use an event and event listener model; no need to modify any core files. The two versions, Revolution and Evolution (the original codebase) have completely different code bases, thus different API functions available.

      One major immediately obvious difference between Revo and Evo comes in adding features to the back-end Manager. Revo has a totally different code base and allows the creation of "CMP" (custom manager pages) as well as allowing a great deal of flexibility in customizing existing Manager functionality. Evo uses what are referred to as "modules". Customizing an existing Evo Manager function requires plugins that use Javascript to manipulate the DOM on the client side.

      For Revo, see http://rtfm.modx.com/display/revolution20/Developing+in+MODx

      For Evo, see http://rtfm.modx.com/display/Evo1/Developer%27s+Guide
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 31783
        • 2 Posts
        i dont understand everything you say, but i think theres a little misunderstanding. i dont have to change anything in modx, i think, but only want and extra thing. i only want to make a custom picture gallery in my own way. the result of that php code is just html, wich has to be included in a content area. the same is in the admin, i have a own upload app in php/java, what i need to have include on an custom page in the admin module. i think i dont need to cgange any of the current functionality ow modx. or do you mean that i have to change the core code to make this work?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          No, you will not need to change any core code.

          It all depends on what you want. See "CMP" for Revo, "Modules" for Evo if you want to add functionality (such as managing a gallery) to the Manager.

          See "Snippets" and "Template Variables" for dynamic code in the HTML of the page, roughly analogous to the embedded <?php ... ?> inline PHP tags in an ordinary .php file. Since MODx is a template-based CMS, snippets and TVs are included in a base HTML structure with tags such as [[snippetName]] or [*TVname*] (for Evo). Again, look over the documentation I linked to for the version you choose to use.

          That said, there are quite a number of different gallery management snippets and modules already available; you might want to look at a couple of them before you lock yourself into developing your own. Again, which one seems good will depend on which version of MODx you decide to use. Personally, I use Evo and for galleries I prefer Easy 2 Gallery.

          http://modxcms.com/extras/repository/packages/?tag=Gallery&repository=10
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org