We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3349
    • 126 Posts
    Does anyone know if non standard document variables work with the Ditto extender?

    I just read this thread http://modxcms.com/forums/index.php?topic=42031.0

    Which PMS states that it doesn’t, that was back in 2009...

    bS
      • 22851
      • 805 Posts
      Hmmm. It’s been a while. Maybe try this:

      [tt]((yams_data:[+id+]:HolidayCost_(yams_id)))[/tt]

      The [+id+] should get parsed by Ditto first and then YAMS should parse the yams_data placeholder... maybe giving you what you want.
        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.
        • 3349
        • 126 Posts
        Thanks for your response! much appreciated in my time of need...

        I added in your suggested code but all I got out was the following on the page

        ((yams_data:249:HolidayCost_en))


        249 is the document id and HolidayCost_en is obviously my multilingual tv.

        Anything else that needs done to read this properly?

        bS

          • 22851
          • 805 Posts
          That looks correct, so I think YAMS should be parsing it. I don’t know why it isn’t. Perhaps you could try changing the cacheable status of the page (and/or Ditto call if it’s going to be outputting static content) to see if that makes a difference.
            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.
            • 3349
            • 126 Posts
            hmm? getting confused now...i’m looking at the YAMS +Ditto Documentation and it says:

            If the snippet call is runnning as cacheable ([[Ditto? ...) then place once copy of the snippet call in each language tab of the document and add

            &id=`id` &language=`language file name`

            to each snippet call, where id is to be replaced by the language group id of the language and language file name is to be replaced with the name of the relevant language file. Also prefix the names any ditto specific placeholders with id_. For example, when using pagination it will be necessary to use [+id_start+].

            When it mentions
            place once copy of the snippet call in each language tab
            what does that mean? Im not sure I follow? currently my Ditto call is placed inside the template that the page is using?

            How do I get it into each tab?

            bS
              • 22851
              • 805 Posts
              I see. If it’s going in the template then it should be okay to do:

              [tt][[Ditto? &id=`(yams_id)` &language=`(yams_mname)` ...[/tt]
                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.
                • 3349
                • 126 Posts
                dear o dear...

                By changing the Ditto call to being [[Ditto?...]] instead of [!Ditto?...!] has just caused the page to load blank??

                Why would that be?
                  • 3349
                  • 126 Posts
                  Is there any other thing I may have omitted here? It seems by your replies that it should work?

                  Dont know whether to continue the investgations or quit and move on?

                  Appreciate any further help on this...

                  Thanks

                  bS
                    • 22851
                    • 805 Posts
                    Hi bigSlim

                    If your template is only going to be used for a few documents, then, if possible, you could try including the Ditto calls within the multilingual content fields of those documents instead of the document template. It would appear from the YAMS documentation that that technique should work.

                    I’m not sure why you get a blank page when your Ditto call is made cacheable, although, if I remember correctly, the combination of whether or not the document and Ditto calls are cacheable is important with or without YAMS. Still, the blank page shouldn’t happen, but I’m unable to spare the time to investigate and I am no longer developing YAMS. If you want to look for clues to the source of the problem I’d check a) the cached content of the affected documents, b) your MODx event log and c) your PHP error log.

                    If you don’t have any luck with that and if no-one else is able to help them I am afraid that you’ll have to move on and try something else.
                      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.
                      • 36404
                      • 307 Posts
                      hi

                      edited, sorry answered the wrong thread...

                      for your holiday cost tv in the template, the YAMS call should be
                      [[YAMS? &get=`tv` &from=`HolidayCost`]]


                      now when it comes to have it in chunks, the easiest way i’ve found out to do this is to do it the YAMS way in... YAMS call
                      i generally use two chunks myChunk_fr, myChunk_en for example in which it easy to output [+myTv_fr+] and [+myTv_en+] and use &tpl=`myChunk_(yams_id)` in YAMS call
                      so far, no issue with this way of working

                      now, when lazy smiley i may use only one chunk and, in this chunk, call a snippet to output the correct language tv content...
                      this is quite easy with a snippet as with
                      $yams   = YAMS::GetInstance();
                      $langId = $yams->GetCurrentLangId();

                      on top of it, you retreive the language currently used but this lazyness is paid by one more instance of YAMS even if fankly it does’nt seem to impact perfomance

                      hope it helps despite my "heavy English"
                      have swing
                        réfléchir avant d'agir