We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43864
    • 151 Posts
    I'm working on a big website with 2 contexts, one for Dutch and one for French. The French site is equal to to the Dutch site.

    my question is this: Is it possible to export al the data from the Dutch context to XML and then import this into the French context? We have a translation company who can deliver the translated XML to us. (so we give them the Dutch XML and they deliver us the French XML). Are there any pitfalls I have to take note of?

    This would spare me an amount of time since I don't have to go from resource to resource to input the translation.
      • 40045
      • 534 Posts
      Something like this is not possible to my knowledge, but it shouldn't be too difficult to write a quick script/snippet (I'd use a temporary script via Console extra) that does that. Something like that

      <?php
      $resobjs = $modx->getCollection('modResource');
      
      foreach ($resobjs as $resobj) {
         $xml = new SimpleXMLElement('<xml/>');
         $xmlres = $xml->addChild('resource');
         $xmlres->addChild('pagetitle', $resobj->get('pagetitle'));
         $xmlres->addChild('longtitle', $resobj->get('longtitle'));
         $xmlres->addChild('content', $resobj->get('content'));
      
         Header('Content-type: text/xml');
         print($xml->asXML());
      }