We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25483
    • 741 Posts
    That was it! Did add the aliasses on every page except the one I was testing on!! So it’s working now wink
      with regards,

      Ronald Lokers
      'Front-end developer' @ h2o Media

    • I’m using this and it works very well, however is there any way to hide the language flag list on monolingual pages (i.e. templates not set up to be multilingual)? I was unable to find a way to get (yams_multi) or (yams_mono) to function on 1.2RC3 - in this capacity at least.
        MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!
        • 22851
        • 805 Posts
        Quote from: Peter at Jul 09, 2010, 12:01 PM

        I’m using this and it works very well, however is there any way to hide the language flag list on monolingual pages (i.e. templates not set up to be multilingual)?
        Yes. Don’t put the snippet call that generates the language list in your monolingual document templates. My answer seems too simple. Have I misunderstood something?!
          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.
        • Quote from: PMS at Jul 09, 2010, 12:34 PM

          Yes. Don’t put the snippet call that generates the language list in your monolingual document templates. My answer seems too simple. Have I misunderstood something?!

          Heh - in order to place the flags where needed the snippet call goes in a chunk that is shared across all templates. I could duplicate the chunk, but rather than do this (and have two chunks to maintain, or split the chunk content out into 6 other chunks) I was looking for a way to control its display on multilingual/monolingual pages!
            MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!
            • 22851
            • 805 Posts
            You could try this: Create a snippet called [tt]LanguageList[/tt] with the following code (untested).
            <?php
            // Load the YAMS class
            require_once( $modx->config['base_path'] . 'assets/modules/yams/class/yams.class.inc.php' );
            // Get an instance of the yams class
            $yams = YAMS::GetInstance();
            // If it's a monolingual document, then don't output anything
            if ( ! $yams->IsMultilingualDocument( $modx->documentIdentifier ) )
            {
              return;
            }
            // Call the YAMS snippet to output the language list.
            // Could call $modx->runSnippet, or we could just launch the snippet directly
            // Edit this to supply your own arguments...
            echo $yams->Snippet(
              'list' // &get parameter
              , NULL // &from parameter
              , NULL // &docid parameter
              , NULL // &beforetpl
              , NULL // &repeattpl
              , NULL // &currenttpl
              , NULL // &aftertpl
              );
            ?>

            This should only create output for multilingual documents. So, just use [tt][[LanguageList]][/tt] instead of [tt][[YAMS? &get=`list` ...]][/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.
              • 12146
              • 7 Posts
              Hi there.

              Relatively new to MODx (1.0.4) and trying YAMS (1.1.9) for the first time.

              I am trying to generate a language drop-down, as opposed to a series of flags (Am told it’s the preferable way to go these days.)

              So I started with your YAMS call, which by the way works perfectly:

              [[YAMS? &get=`repeat` &beforetpl=`@code:<ul>` &repeattpl=`otherFlagItemTpl` &currenttpl=`currentFlagItemTpl` &aftertpl=`@code:</ul>`]]
              


              and modified it thus:

              [[YAMS? &get=`select` &beforetpl=`@CODE:<select name="langDD" onchange="javascript:self.location=this.value;" >` &repeattpl=`flagItemDDTpl` &currenttpl=`flagItemDDTpl` &aftertpl=`@CODE:</select>`]]
              


              where flagItemDDTpl is this chunk:

              <option class="yams_lang_(yams_id)" value="(yams_docr)" lang="(yams_tag)" xml:lang="(yams_tag)" dir="(yams_dir)" title="(yams_name_in_(yams_id))" >(yams_name)</option>
              


              I am getting the drop-down, but no action, i.e. nothing happens when I select another language. I have tried &get=selectform, with the same results.

              Any ideas what I might be missing?

              Thanks.


              Regards,
              Les@ITworks
                • 12146
                • 7 Posts
                Actually it was as simple as:

                [!YAMS? &get=`select`!]


                and then just had to do some minor tweaking to the template files under \assets\modules\yams\tpl\yams\select.

                Works like a charm.

                Thank you just the same. grin


                Regards,
                Les@ITworks