On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hello!
    I’ve installed YAMS 1.1.9 on clean MODX 1.0.3 installation. Everything is fine, multilingual content is displayed ok but I cannot get menu to display correctly! It doesn’t display anything, on any language, although the list and links are created. The rendered HTML code looks like this:


    ....
    <li>
    <a href="http://www.mydomain.com/mxnew/hr/index.php?id=51" title="" ></a>
    </li>

    <li>
    <a href="http://www.mydomain.com/mxnew/hr/index.php?id=52" title="" ></a>
    </li>
    ....

    I have doublechecked installation steps, is there something else I could check?
    The ’menutitle’ field for each language should be taken for generating menu labels automaticaly?

    Thank you in advance.
    • Did you follow the directions for using Wayfinder with YAMS? http://svn.modxcms.com/docs/pages/viewpage.action?pageId=13205620
        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
      • yes, i use this call:

        [[Wayfinder? &startId=`0` &level=`1` &rowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/docr/row.tpl`]]


        is there another i could try?
        • Your Wayfinder call looks fine to me. With this snippet call the content from the multilingual menutitle fields (menutitle_en, etc.) should be used for the menu link text and the content from the multilingual pagetitle fields (pagetitle_en, etc.) should be used for the title text for the links which appear when they are hovered over. I’m not sure why that’s not happening in your case. Perhaps you are missing or have misplaced a plugin event for the YAMS plugin?
            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.
          • i have tripple checked that to... i really don’t know what could be the issue here and I wouldn’t like to start looking for another CMS just becouse of that menu. I was thinking I could bypass that issue if I would create (complete code) different files for every menu (for example en_menu.php, de_menu.php, it_menu.php,...) and to include the correct one based on current selection. Do you know how can I get current language into variable?

            So i could use in my template something like:
            <?php
            include 'LANGUAGE-VARIABLE_menu.php';  
            ?>
            • I do know how to get the current language into a variable. With MODx PHP code normally lives in snippets. You can’t put your PHP code directly in your document template, but you can create a snippet for it and put it in that. Imagine that your snippet is called [tt]mymenu[/tt]. Then you would include the snippet in your template like so:
              [[mymenu? &id=`(yams_id)`]]

              I have added one parameter to pass the language id into the snippet. If YAMS is installed correctly the variable [tt]$id[/tt] will become available within the snippet and YAMS will ensure that [tt](yams_id)[/tt] evaluates to the id of the current language. For the snippet code you could then use:
              <?php
              include $id . '_menu.php';
              ?>


              MODx gives you the flexibility implement your site like you want, so you could use that approach if you wish. However, you would miss out on all of the features of the Wayfinder snippet, so it would be good if we could work out why Wayfinder + YAMS extension is not working for you.
                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.