We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17012
    • 5 Posts
    MODX v 1.0;14 + YAMS v1.1.9

    I'm a semi-technical user of Modx and have made a couple of websites in Evo as still haven't really got into Revo yet.

    My latest project is a multilingual one English,Italian & Russian. YAMS so far has been great and I've managed to get it working throughout most of the site but I just hit a snag. I want to use another older snippet "Gmaps" for Evo. This map snippet is called in the content of each language but always displays the Russian version of the map no matter what I try.

    This is the GMaps code I'm using:

    [!Gmaps?
    &mapId=`Gmaps`
    &extenders=`@FILE assets/modules/yams/yams.extender.inc.php`
    &id=`(yams_id)`
    &language=`(yams_tag)`
    &zoom=`6`
    &mapType=`ROADMAP`
    &mapWidth=`700px`
    &mapHeight=`700px`
    &mapLatLng=`41.875901, 12.441775`
    &markers=`c11`
    &mkrLatLngTv=`PropertyMapLatLng`
    &mkrIconTv=`PropertyMapMarker`
    &mkrClick=`link`
    !]

    I was puzzled but on looking at the browser source I see although the language code &language is being set correctly for the maps the problem is that all language versions of the "Gmaps" script appear in the source after each other with of course the last one being the Russian one and hence why this one is finally displayed.

    I saw in the YAMS documentation some comments that all language versions of snippets are generated but that this is sorted out before the page is rendered. I'm calling the snipped directly i.e. "[!Gmaps ...." should I be doing this another way.

    I found the explanation in the YAMS documentation regarding using with other snippets a bit vague with no real examples.

    I'd be very grateful if someone can offer a bit of advise where I might start looking for a solution or what I'm doing wrong.
    Many Thanks in advance for any help. [ed. note: lesw last edited this post 9 years, 6 months ago.]
    • The issue that occurs should be the following: YAMS parses every language that is available for the resource and just hides the output for the other languages. Now the Gmaps snippet is executed three times and this Snippet inserts the javascript code with regClientScript at the end of the body. The problem: YAMS does not take care for regClientScripts.

      A possible solution is to rework the snippet: Remove the regClientScript calls for language specific code and output that code directly at the place where the Gmaps snippet is called.
        • 17012
        • 5 Posts
        Many Thanks Jako, I should have guessed that it wouldn't be as simple as I thought. YAMS worked so flawlessly so far that I just took too much for granted.
        I'll have a look at reworking the snippet as you suggest.
        Thanks again!

        Quote from: Jako at Oct 07, 2014, 10:37 AM
        The issue that occurs should be the following: YAMS parses every language that is available for the resource and just hides the output for the other languages. Now the Gmaps snippet is executed three times and this Snippet inserts the javascript code with regClientScript at the end of the body. The problem: YAMS does not take care for regClientScripts.

        A possible solution is to rework the snippet: Remove the regClientScript calls for language specific code and output that code directly at the place where the Gmaps snippet is called.