We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29635
    • 361 Posts
    Hi all.
    Appologies if the answer is clear as day and I just can’t see it, but...

    Two sites need to have 1 shared "network status" section (like http://cari.net/network-status"" target="_blank" rel="nofollow">this and http://complexdrive.com/network-status"" target="_blank" rel="nofollow">this). This section is pretty active and should be identical in both sites, but needing to perform duplicate updates on two separate sites is kind of lame.

    Currently, I have one site just pulling the HTML straight from one to the other (grabbing all content within some comment tags). This works ok, but disallows any sort of archiving, as any generated links would not translate from one site to the other.

    My best idea is to create a 3rd MODx installation that just handles the network status section, and have both sites include that 3rd site in an iframe or something (perhaps dynamically resising like http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm"" target="_blank" rel="nofollow">this). There are still some issues with that technique, though (including the difficulty with loading pages from a separate domain).

    Does anybody have any better ideas than including it in an iframe? I have a feeling I’m missing something, but I’ve been thinking about this for a few weeks now and haven’t come up with anything really good.

    Thanks as always for your time and ideas.
    -Brett
      Need MODx Ecommerce? Try FoxyCart!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Why not make a plugin (using the onDocFormSave even) that directly connects to the other’s site_content table? When one gets saved, it updates into the other one. The plugin could have a conditional block to only deal with a given document ID. You would need to create a new database object; call it $remotedb or something.
        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
        • 33337
        • 3,975 Posts
        Try this: http://modxcms.com/MODxAPI-Library-865.html

        Description: This Library can be very useful to those who would like to connect to and execute MODx documents and APIs from an external application.

        regards.

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

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 29635
          • 361 Posts
          zi and Susan, thanks a lot for the tips. I’ll look into those options and update if I figure anything out that might help others.
            Need MODx Ecommerce? Try FoxyCart!
            • 29635
            • 361 Posts
            Quote from: sottwell at Aug 29, 2006, 10:46 PM

            Why not make a plugin (using the onDocFormSave even) that directly connects to the other’s site_content table? When one gets saved, it updates into the other one. The plugin could have a conditional block to only deal with a given document ID. You would need to create a new database object; call it $remotedb or something.
            Susan, could you shine a little more light on this for me? I understand the concept of using a plugin to connect to the other site’s site_content (and the TV table as well), but I’m not sure how Site 1 (the "main" site) would know which document on Site 2 to connect to on a save at a later time.

            In other words, let’s say I create new content on Site 1 on Monday, it duplicates the content into Site 2. Then I come back to the same document on Site 1 on Tuesday and change a TV. When Site 1 reconnects to the Site 2 database, how would it know to overwrite the existing document on Site 2 and not just create a new one? An extra DB table perhaps?

            Also, could you explain a bit what you mean by "have a conditional block to only deal with a given document ID"?

            Thanks so much for the help. It’s greatly appreciated, as databases aren’t my strong point.
              Need MODx Ecommerce? Try FoxyCart!