We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29861
    • 59 Posts
    I implemented [Tutorial] Multilingual Websites with MODx (improved version): http://modxcms.com/forums/index.php/topic,29597.msg179898.html

    My language php files look like that:
    <?php
    // servicesList chunk
    $__lang["Services"] = "Serviços";
    $__lang["Projects_with"] = "Projetos com ";
    
    // set placeholders
    foreach ($__lang as $key => $value) {
    	$modx->setPlaceholder("@".$key,$value);
    }
    ?>


    Then I use the placeholders like that: [+@Services+] or [+@Projects_with+].

    THE PROBLEM: If I use the placeholders in a cacheable environment like inside a snippet using [[Snippet ...]] call or inside a page defined as "Cacheable" in the "Settings", the placeholders are empty!!!!!!! Sometimes they aren’t but the 2d time I load the page they are....

    For the moment I disabled all the Cache functionalities but it’s not really clean.

    Anyway around that??? huh

    Thank you for helping me.

      • 29861
      • 59 Posts
      I’m still looking for an answer to this problem.
      huh huh huh
      Anyone?
        • 22303 MODX Staff
        • 10,725 Posts
        In Evo, if a Snippet is responsible for setting placeholders and the Snippet is cacheable, the placeholders will not be set again after the cache is created; there is no way around this without making the page non-cacheable or setting the placeholders and returning the content containing the placeholders from non-cacheable Snippets.

        Unlike Evo, Revo allows you to mark placeholder tags (or any tag for that matter) as non-cacheable and thus you can use them within cacheable content as a result. However, you would still need to make sure the Snippet that set the placeholders was non-cacheable as well.