We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3349
    • 126 Posts
    Currently im using the following Ditto Call

    [!Ditto? &parents=`246` &display=`all` &orderBy=`menuindex ASC` &tpl=`holidaysTPL` &extenders=`@FILE assets/modules/yams/yams.extender.inc.php` &id=`(yams_id)` &language=`(yams_mname)`!]


    This pulls through everything other than the HolidayCost tv that I have created as multilingual TV’s. "HolidayCost_en" & "HolidayCost_es"

    Can anyone tell me why the following code (in my holidaysTPL chunk) doesn’t work? Am I doing something completely wrong?

    [+(yams_id)_HolidayCost+]


    Im following the setup guide http://rtfm.modx.com/pages/viewpage.action?pageId=13205618

    Thanks
      • 3349
      • 126 Posts
      *BUMP*

      I guess what I want to ultimately do is call
      (yams_id)
      in a chunk.

      I have two TV’s "HolidayCost_en" & "HolidayCost_es"

      I can call them individually by referencing them in the chunk but I obviously need to make it dynamic and use
      (yams_id)


      What am I missing guys?

      Thanks
      • You don’t. YAMS automatically fetches the correct one for the language being used. Just use the TV name as you normally would, [+HolidayCost+]. You would only use the yams_id prefix for placeholders in the main page outside of the Ditto chunk tpl, such as for the pagination placholders.
          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
          • 3349
          • 126 Posts
          Hi Susan

          Thanks for replying, as always!

          I had tried this (and indeed have tried again since your reply) but nothing gets displayed?

          If I hardcode in [+HolidayCost_en+] the english version appears fine or likewise with the spanish version [+HolidayCost_es+] but this is useless when switching language in the front end?

          Does this make sense to you? Any other ideas?

          • Maybe try [+HolidayCost_(yams_id)+] ?
              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
              • 3349
              • 126 Posts
              Yeah, tried all these cominations sad

              Actaually [+HolidayCost_(yams_id)+] made more sense to me and I thought that would solve my problems but its not to be the case...

              WTF?
                • 3349
                • 126 Posts
                If I put in [*HolidayCost_(yams_id)*] into the actual template it works fine...

                Why will it not work from within a chunk tpl? Where I need it to work....

                Man its so frustrating?

                bS
                  • 3349
                  • 126 Posts
                  Further observations...

                  Using [[YAMS? &get=`text` &from=`HolidayCost`]] returns the TV name "HolidayCost_en" or "HolidayCost_es"

                  or [[YAMS? &get=`data` &from=`HolidayCost`]] returns the value I have set as the default for the TV - £0.00 or €0.00

                  Sorry to keep bangin’ on but what can I do to get the actual value of the TV?

                  bS
                  • Are you sure the Ditto extender is working?
                      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
                      • 3349
                      • 126 Posts
                      Here is my ditto call

                      [!Ditto? &parents=`246` &display=`all` &orderBy=`menuindex ASC` &tpl=`holidaysTPL` &extenders=`@FILE assets/modules/yams/yams.extender.inc.php` &id=`(yams_id)` &language=`(yams_mname)`!]


                      Its definitely in the directory at that location. How would I check its working?

                      Thanks