We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36516
    • 179 Posts
    Yo dudes

    I need to build web shops, but shop apps don't CMS too well and CMS plugins are heavy-handed shops in my experience, so I'd like to use MODx for the CMS and Opencart or similar for the shop.

    Here's the kicker: I could SWEAR I read a good while ago that the MODx core had been engineered in such a way that it granted developers many wonderful benefits. One such benefit sounded (at the time of reading) like you could call an instance of the core from within an unrelated script, and then use it to access certain template chunks of the parent MODx site.

    For example, say you had a web shop but you want to render a complete, dynamic, fully functional MODx-powered main menu at the top. You might have a script, or a plugin for your shop app that could then produce just the main menu template code and nothing else. So you could have elements of MODx bleed into the shop pages, or visa-versa, thus allowing you to use MODx to run part of the site, the shop app to run the shop part, but have elements of both on certain pages. Typically I might want the reverse: to have the shop mini-basket appear on the MODx pages.

    I've researched long and hard and can find no evidence of what I'm sure I read before. I'd love it if someone to speak to this issue and confirm whether or not it's possible to do what I've described above. Just 'print out' the main menu of a modx site so I can use MODx to make a menu that appears within a different app's theme engine.

    Choosing web apps is becoming a real pain. I have clients who are consistently using inconveniently shady crap like Joomla and Virtuemart - a horrible combination if ever I saw one. Suggestions I'm receiving include using WordPress and one of its many plugins in stead, but that just means you don't get the best of either world.

    I want the power of MODx, merged with the features of Opencart, without having to customise two cores. I'm SO SURE I read you can use the MODx core in third party apps like this. Anyone know what I'm talking about?

    Cheers

    Dave
      • 3749
      • 24,544 Posts
      Yes, you can instantiate MODX from any PHP script and use many of its features to do pretty much whatever you want (e.g., $modx->getChunk(), $modx->runSnippet()).


      That said, I'm not sure it's the best approach for what you want to do.
        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
        • 36516
        • 179 Posts
        Quote from: BobRay at Feb 26, 2014, 02:30 AM
        That said, I'm not sure it's the best approach for what you want to do.

        Thanks Bob. I don't suppose you can elaborate on that, can you?

        Also, it'd help me a lot if someone could point me in the direction of some documentation on doing what's described above, if only to save me the time hunting for it.
          • 3749
          • 24,544 Posts
          I don't generally do e-commerce sites, so I'm not the best guy to advise you. It's my understanding, though, that most people go the other way. Either they Build the site in MODX and integrate the cart software, or they use MODX for the main site and the cart software just for the cart itself (styled to look like the MODX site).

          I'm sure someone with more e-commerce experience could give you a much better answer.
            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
            • 25803 ☆ A M B ☆
            • 721 Posts
            You could create a page without a template in MODX that is published but hidden from menus.
            On that you could use your Wayfinder call for your main menu, making sure you have &scheme=`full` to output full URLs.
            And then use a CURL method, such as this: http://www.sitepoint.com/using-curl-for-remote-requests/ (in the Retrieve a Web Page section) that points to page that outputs just your main menu.