We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22851
    • 805 Posts
    The YAMS Ditto extender says what to return when a placeholder is encountered in a Ditto template. This could be altered to output nothing for monolingual documents when the current language is not the default... but this would only apply to individual placeholders, not the whole ditto template.

    You’re right that the YAMS snippet outputs a special construct that is parsed by the YAMS parser, so yes, you could write out a YAMS construct directly. The thing to be aware of is that each YAMS construct needs a unique id. This id is normally generated by the YAMS snippet, which is why I normally don’t advise writing them directly. However, provided you use them with care there should be no problem:

    When building a document for the first time the YAMS snippet starts numbering an YAMS constructs it creates from 0 or 1. When loading from the cache the YAMS snippet starts numbering from 50000. So, to be sure that you don’t give your own construct an id that ends up clashing with one auto-generated by the YAMS snippet I suggest using an id that starts from, say, 90000. You’ll need to use a yams-select construct, as described in the YAMS documentation. So your ditto parameter would look like (untested):

    &filter=`(yams-select:90000)(lang:90000:en)template,15,2(/yams-select:90000)`


    Hopefully this will work for you until I can implement a better solution for excluding content (Wayfinder/ditto templates) based on language settings. I think it’s a cleaner solution than having to modify the Wayfinder snippet anyway.
      YAMS: Yet Another Multilingual Solution for MODx
      YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
      Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
      • 25260
      • 156 Posts
      This is perfectly working.

      Btw I had already modified the Wayfinder snippet to fit my needs, so I don’t bother modifying it again for YAMS.

      Thank you again,

      Roberto