On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • I am using modx 1.0.4 and ditto 1.2.0 RC3
    I have a ditto call for a list of references.

    After one year of beeing online I had to change introtext_de and introtext_en to a richtext field.
    All entries of introtext_de with entities in it are not displayed on the list.

    [[YAMS? &get=`text` &from=`de::[+introtext_de+]||en::[+introtext_en+]`]]

    Any idea?



    • hi

      introtext being a tv for YAMS, you may try

      [[YAMS? &get=`tv` &from=`introtext`]]

      have swing
        réfléchir avant d'agir
      • Be aware that naming a TV with the same name as a standard resource variable (pagetitle, longtitle, introtext, etc) will cause problems.
          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
        • Okay, but what else can I do to solve that problem if [[YAMS? &get=`tv` &from=`introtext`]] will cause problems?

          • Name your TV something else. I’m not saying that in this case it will cause a problem, just that it’s a bad idea in general to use the same names. At the least, it can be confusing to the user which "introtext" is being referred to.
              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
            • hi,

              actually, what Susan means is that it’s not a good idea to use some "reserved" tv names for personal ones
              now, if you’ve juste changed the entry type of the "native" YAMS introtext_en... this will not be a problem

              have swing
                réfléchir avant d'agir
              • hi virtualgadjo

                I have changed that call now to
                [[YAMS? &get=`tv` &from=`de::[+introtext_de+]||en::[+introtext_en+]`]]

                but it still does not display, even the other ones that have been displayed before do not show up now.

                ??????

                • hi,

                  this kind of YAMS call is usually used for text, e.g
                  [[YAMS? &get=`text` &from=`de::i do not speak german||en::english, a little bit more...`]]


                  when you retreive a tv content, you normally just have to write
                  [[YAMS? &get=`tv` &from=`introtext`]]


                  yams will find the right language out by itself, if not (don’t know why but let’s say it happens)
                  [[YAMS? &get=`tv` &from=`introtext_(yams_id)`]]

                  should solve the problem

                  Have swing
                    réfléchir avant d'agir
                  • hi virtualgadjo,

                    I have tried all three versions but none of them works. I am using a single chunk for both languages.
                    If I use
                    [[YAMS? &get=`tv` &from=`introtext`]]
                    no content of introtext is displayed

                    If I use
                    [[YAMS? &get=`tv` &from=`introtext_(yams_id)`]]
                    it displays e.g. introtext_de_de but no content of introtext.

                    if I use
                    [[YAMS? &get=`text` &from=`introtext_(yams_id)`]
                    it only displays introtext_de_de but no content of introtext

                    if I use
                    [[YAMS? &get=`text` &from=`introtext`]] 
                    it only displays introtext_de but no content of introtext.

                    if I use
                    [[YAMS? &get=`tv` &from=`de::[+introtext_de+]||en::[+introtext_en+]`]] 
                    it displays no content of introtext.

                    Only
                    [[YAMS? &get=`text` &from=`de::[+introtext_de+]||en::[+introtext_en+]`]] 
                    works but does not display if a entity is in the content of introtext


                    just to complete my explanations my call to that list is
                    [[tvExplorer? &dittoName=`Ditto` &formTPL=`RefSearch` &dittoSnippetParameters=`tpl:ReferenzenListe|debug:0|paginate:1|depth:4|parents:5|display:20|dateSource:Referenzdatum|showPublishedOnly:1|sortBy:Referenzdatum|sortDir:DESC`]]
                    • Hi,

                      ow sorry, i hadn’t understood this formerly, i thought you were using that yams call in a template or in a simple content, not in a chunk you’re parsing with a snippet

                      i don’t know tvExplorer at all... and the ditto extender for yams seems to be missing in it’s call

                      though, as yams seems to work in the chunk you may try this syntax
                      [[YAMS? &get=`data` &from=`introtext` &docid=`[+id+]`]]

                      or this one (actually near your former one but without the placeholders signs
                      [[YAMS? &get=`tv` &from=`de::introtext_de||en::introtext_en`]]


                      if it doesn’t work, i think an other (and simple) way to solve your problem would be to write a snippet that will retreive the correct tv depending on the languague and return its content (really easy to do) and then call that snippet in the chunk) let me know if you need help for that

                      Haves swing
                        réfléchir avant d'agir