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

    I was suggested to Modx by someone and was just wanting to ask a couple questions to see if Modx would be right for what I am trying to achieve.

    My main question, is if Modx supports PHP code/scripting within pages as I know a few CMS’s don’t support that or either don’t support it very well ( not giving alot of options ).

    Basically I want an CMS that I can easily add additional modules/plugins ( however you call them )....this would include database alterations, allowing guests to submit information via a form, etc. And if there is anyway to create a plugin/module for the admin side, or is that a whole different situation?

    i also heard that Modx integrates with SMF, does this mean member integration as well, or only through the template?

    Thanks!
    • PHP code is added to a MODx template or document via the snippet or TV (Template Variable) mechanism. Your code is "included" with MODx tags such as [[SnippetName]] or [*TVName*]. You could say that these tags replace the traditional <?php...?> tags, but they can do much more. The excellent wink documentation is quite extensive.

      Modules are easily created for adding management features to the back-end, or the user system can be used to control access to management features added to front-end snippets.

      The SMF bridge manages user integration.
        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
        • 10395
        • 96 Posts
        Hi,

        Thanks for the fast reply smiley.

        So far all sounds good. I took a glance at the documentation and it seems to be very in depth, so nice job on that wink.

        I think I will give Modx a try and if i run accross any bumps in the road along the way I’ll be sure to drop by again smiley.

        Just for clarification for myself.....are snippets/plugins the same thing? And are modules only created for back-end management?

        And for modules, i can also use PHP/MySQL ? As i’ll be needing to select information from a database and make alterations to it, etc.

        Thanks.
          • 33337
          • 3,975 Posts
          Nice to have you onboard Gaia smiley

          Snippets: You can use your scripts in it to run inside MODx

          Plugins: You can use them to over-ride system events.

          We have dbapi for DB manipulation.

          regards,

          zi
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • Snippets, modules and plugins are all "containers" for PHP functionality. They can even be a two-liner to include() an external ordinary php file and then return its output if necessary. That’s the only thing that needs to be remembered about using PHP code in MODx, since it’s passed through a template parser it won’t automatically create a page to display output. It can echo or print, but otherwise output must be captured in a variable and the variable returned.

            Chunks are pure ... well, chunks ... of HTML (which can included snippet and TV tags). Convenient for consistant bits of content, such as header or footer content that you want repeated for all pages, even if they use different templates. Also often used as form or layout templates for various snippets, such as the login snippet or the news article summary display snippet.

            Modules work in the backend as extension to the Manager (see my in-progress ecommerce management module for an example, login as guest password guestuser and run the ShopX module), plugins work invisibly during the system processing, whether front-end or back-end depending on the events it is set to intercept (I’ve used them for managing the SESSION for maintaining a shopping cart and for a cookie-based template switcher); snippet output and chunks are inserted into the document during document parsing by the MODx parser engine.

            TVs are a special case of front-end insertion, whether they are HTML code like a chunk, or use the various @ bindings, or generate "widgets". TVs become quite addictive once you get a taste of the power.
              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
              • 10395
              • 96 Posts
              hey Zi ^_^.

              Thanks for the explinations, helps alot and modules are what what i’m looking for.

              just a last question wink

              The SMF bridge, does that require that both SMF and Modx database tables are in the same database?

              Thanks again!
                • 33337
                • 3,975 Posts
                Quote from: Gaia at Apr 03, 2006, 03:32 PM

                The SMF bridge, does that require that both SMF and Modx database tables are in the same database?

                not at all smiley
                  Zaigham R - MODX Professional | Skype | Email | Twitter

                  Digging the interwebs for #MODX gems and bringing it to you. modx.link