We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9994
    • 133 Posts
      Best CMS eva!
      • 14404
      • 84 Posts
      Yes, thats the one i’m using wink
        • 22851
        • 805 Posts
        Hi Joeeeey.

        I just replied to your personal message, but I thought I would share my reply here too. (This version is slightly updated.) I think what you are looking for is for a way to automatically populate the multilingual menutitle fields with some other content.

        I need to check this, but as far as I understand MODx doesn’t do any auto-populating of the menutitle field by default - which is why YAMS doesn’t. It is normally left to tools like ManagerManager to achieve that, or to snippets like Wayfinder to use a different field when the menutitle is blank. However, unfortunately ManagerManager can’t be used to synchronise template variables, so I doesn’t help here for the multilingual TVs and when using the YAMS Wayfinder templates usage of a different field if the menutitle field is blank doesn’t work either.

        Fortunately, someone else requested an ’auto-populate menutitle field’ functionality before Christmas and I implemented a patch that will automatically populate the multilingual menutitle field with the contents of the pagetitle field (for each language) on document save - but only if the menutitle field is blank. I have just generated an updated yams.plugin.inc.php patch that includes this functionality plus any other mods/bug fixes that I have implemented since 1.1.7 alpha RC7. You can download it from my server. Hopefully that will be of use to you.

        I hope to find some sensible way of allowing this to be configured for the next version of YAMS. Not everyone will want the synchronisation and some people will want to synchronise different fields.
          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.
          • 10313
          • 375 Posts
          May I interrupt here ...

          I had set up ManagerManager (in evolution 1.0.2) to synchronise the multilangual pagetitle and menutitle form fields. It word perfectly (however, I had to add one ManagerManager-rule per language, but that was okay).

          This worked very fine for me until I showed this to my customer. They now want to use the menutitle field for menue names differing from pagetitle, that’s just what the menutitle was intended for, I think.

          So I tried to change my Wayfinder rowTpl, but I couldn’t get it running, may be I can ask my question here, because it is related.

          My rowTpl looks like
          <li[+wf.id+][+wf.classes+]>
            <a href="(yams_docr:[+wf.docid+])" title="[[YAMS? &get=`data` &docid=`[+wf.docid+]` &from=`pagetitle`]]" [+wf.attributes+]>[+phx:if=`[+wf.docid+]`:eq=`17`:then=`{{shopbtn}}`:else=`[+phx:if=`[[YAMS? &get=`data` &docid=`[+wf.docid+]` &from=`menutitle`]]`:ne=``:then=`[[YAMS? &get=`data` &docid=`[+wf.docid+]` &from=`menutitle`]]`:else=`[[YAMS? &get=`data` &docid=`[+wf.docid+]` &from=`pagetitle`]]`+]`+]</a>
            [+wf.wrapper+]
          </li>


          The interesting part is the output of the menu text, wich is:
          [+phx
          :if=`[[YAMS? &get=`data` &docid=`[+wf.docid+]` &from=`menutitle`]]`
          :ne=``
          :then=`[[YAMS? &get=`data` &docid=`[+wf.docid+]` &from=`menutitle`]]`
          :else=`[[YAMS? &get=`data` &docid=`[+wf.docid+]` &from=`pagetitle`]]`
          +]`
          

          (line breaks added for better readability only)

          I have deleted all TV data records for the menutitles from within phpMyAdmin. So there is no value stored. I thought, I would now see the pagetitles in my menu. But no, all menus are empty. If I output directly
          [[YAMS? &get=`data` &docid=`[+wf.docid+]` &from=`pagetitle`]]
          then I get my correct pagetitles.

          So I think something is "wrong" with the YAMS snippet. What does it return, if it finds no value?

          Any help very much appreciated smiley
          Greetings from Germany
          Martin
            • 22851
            • 805 Posts
            @FuryDE.

            Please share the ManagerManager rule you used! I’m sure I could generalise it to loop over the available languages automatically.

            Sorry to answer your question with a question - but which appears first in your plugin execution order. PHx or YAMS? If it’s PHx then that could be the problem. The YAMS snippets output special constructs all of which need to be parsed before PHx does its work.

            @Joeeeeh.

            Following on from your personal message I see that you want to fall back to the default language menutitle if the menutitle for a given language is left blank. You might be able to accomplish this with PHx in your Wayfinder snippet, so please follow @FuryDE’s question. If we can sort out this PHx YAMS compatibility issue then it might provide the solution your looking for.
              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.
              • 10313
              • 375 Posts
              The rule is
              mm_synch_fields('pagetitle_de,menutitle_de');

              You need one rule per language. Must be added manually.

              YAMS is executed before PHx, and usually, it works fine. But not in this special case.