We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2656
    • 44 Posts
    Hi gays, excuse me, i`m badly speak english.

    When i call page with additionsl params like this:

    http://hc/en/catalog/simona/all.html?gid=9&type=1&display=all


    all is ok, but when i click on language change link url becomes like this:

    http://hc/cz/catalog/simona/all.html


    So, how can i save additional params ?
      • 22851
      • 805 Posts
      I would create a snippet called QueryParams with code similar to this (untested):

      <?php
      // build the query string using the parameters I want to redisplay...
      $queryParams = array();
      foreach ( array( 'gid', 'type', 'display' ) as $param )
      {
        if ( array_key_exists( $param, $_GET ) )
        {
          $queryParams[] = $param . '=' . rawurlencode( $_GET[ $param ] );
        }
      }
      if ( count( $queryParams ) > 0 )
      {
        return '?' . implode( '&', $queryParams );
      }
      return '';
      ?>
      


      Then in my document or YAMS list or selectform template I would use [tt]"(yams_doc:[*id*])[!QueryParams!]"[/tt] to generate the full multilingual URL plus query string.
        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.
        • 2656
        • 44 Posts
        Thank you, i`m understend you decision.

        It`s so simple wink
          • 9994
          • 133 Posts
          [move]Hi gays, excuse me, i`m badly speak english.[/move]

          U mean guys lol. Gays means homesectuals tongue
            Best CMS eva!
            • 2656
            • 44 Posts
            grin excuse me...