We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Couldn’t that be made into a plugin?
      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
      • 23323
      • 12 Posts
      Quite possibly. I haven’t looked at what it would take to make a plugin. I’m not sure at what point the first part (the part that goes into the index.php file) stops working (all I know is it errored out in a snippet). I would be happy to check out the docs on writing a plugin and seeing what would be necessary. I’ll also look up what other Wordpress variables might need to be globalized and post them here.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        It looks like you would just take those lines of code, put them in a plugin, and then choose the appropriate event to use (I still tend to end up with a lot of trial-and-error there, as I still haven’t totally gotten a handle on which event is activated where!); at least it would most definitely be one of the events in the first section, such as onDocumentLoad or something.

        I do something similar for the (will be actually finished someday rolleyes ) ShopX app; I use a plugin to grab all the GET and / or POST values from the page load and put them into arrays in the SESSION, just to be double-sure the values are all available in one place for the snippets to work with later in the document parsing process.
          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
          • 23323
          • 12 Posts
          I stuck
          define('WP_USE_THEMES', false);
          require('./flog/wp-blog-header.php');
          


          In a plugin and was unable to get it to work (numerous events were tried). Im not able to find any documentation about the various events, so I’m not going to try to debug it just right now (unless you can point me at some info). It would make sense to me that there would be someway to add it into MODx without modifying the index.php file, but I don’t really know where to look.
            • 25663 MODX Staff
            • 12,272 Posts
            Event documentation is definitely lacking and something that needs to be gone through with a fine-toothed comb to document all the various places events fire code.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 2581
              • 10 Posts
              I’m wondering if any headway has been made with this? I have a Wordpress blog that I have been running for 2 years and would like to either run it inside a new modx site or do a complete import of the wordpress data if that is possible.

              This thread looked like the most promising but is also very old.

              Hopefully hear from someone.

              Alan
                Loving modx but hating too... is that a love hate thing or what?
                • 23323
                • 12 Posts
                The stuff that I posted here was pretty much as far as I got. It should work for you for the most part. I walked away from MODx shortly after this. Its a really nice system but there were enough problems that I figured I’d let it mature a little before I used it any more. I wasn’t able to get any "good" integration, but if you do those includes you should have a functional loop (you can add to the include if you come up with more variables that you need access too, I think I had 3 or 4 when I was done).

                I would also be willing to take a look at it again if I had someone to chat about it with.
                  • 2581
                  • 10 Posts
                  Hi there, thanks for getting back to me.

                  This has been a bit of a back burner creeping up on me but is getting closer, I am up for looking into this with you if you like however I would have to admit that I am no expert when it comes to the *guts* of wordpress. Wordpress is a complex beast but beautiful at what it does, I just have a need for more which is why I am heading towards ModX.

                  Cheers... oh, and I will keep logging in now as I have plenty to be working on with ModX at the moment.

                    Loving modx but hating too... is that a love hate thing or what?
                    • 23323
                    • 12 Posts
                    All this code does is allow you to use the loop to display posts in a MODx. Are you trying to do more than that? Do you have an example of where you’ve tried this and it hasn’t worked? Do you have test site setup? I can set one up otherwise.
                      • 36592
                      • 970 Posts
                      Perhaps I don’t exactly understand what "WordPress Loop" is and the goal of this thread, but does this "WordPress Integrator" Snippet and Plugin by uglydog have something to do with this ?

                      http://modxcms.com/forums/index.php/topic,13054.msg86329.html#msg86329

                      The content of the post is a little bit old ( the latest version is 1.2.0 and it works with the alias path turned on. ), but I am using WordPress 2.2.1 and MODx 0.9.5 with this snippet and plugin. I can list posts in various ways ( Day/Month/Category etc. ) and add comments to those posts through the MODx interface. But some Errors are logged in the Eventlog of MODx with a every single click... I think it still needs some tuning.