We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21778
    • 223 Posts
    There seems to be some issues with maxigallery when running yams.



    • For starter, first thing i have noticed is some path issues.

      I’m using these parameters "&display=`embedded`" and "&embedtype=`lightboxv2`"
      - so there are some lightbox scripts + the default.css file in my <head> however their paths are messed up.

      Example: src="/fa/assets/snippets/maxigallery/lightboxv2/js/lightbox.js

      somehow the language code is applied to the path so it dosent work.

      In the snippet code in manager the correct path is defined so i dont know how it get screwed up:

      // Path where MaxiGallery is installed
      define(MAXIGALLERY_PATH, "assets/snippets/maxigallery/");

      ..and in maxigallery.class.inc.php the path is used:

      $lightboxv2_script_link5 = $modx->config[’base_url’] . MAXIGALLERY_PATH . ’lightboxv2/js/lightbox.js’;

      The default css is also outputted with the language code /fa/

      $mgconfig[’css’] = (isset($css)) ? $css : MAXIGALLERY_PATH.’css/default.css’; // [ text ]
      --> /fa/assets/snippets/maxigallery/css/default.css


    Help greatly appreciated :- ))
      • 21778
      • 223 Posts
      It works if i don’t use root names, however now when i change language and navigate to a different page the language resets to default :-/
        • 21475
        • 80 Posts
        Hi,

        I don’t have maxigallery, but i have this issue with images inserted directly in tiny MCE.
        Images are searched in /fr/assets/images instead of /assets/images.
        Images path is assets/images/myimage.jpg in the source code.

        Maybe it is due to relative image path (but i’ve tried with absolute image path, nothing change).

        So, adding this rule to .htaccess solved my issue :
        RewriteRule ^en/assets/(.*)$ assets/$1 [L]
        RewriteRule ^fr/assets/(.*)$ assets/$1 [L]


        So my .htaccess looks like :
        Options +FollowSymlinks
        # Friendly URLs
        RewriteEngine On
        RewriteBase /modx
        
        # Fix Apache internal dummy connections from breaking [(site_url)] cache
        RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
        RewriteRule .* - [F,L]
        
        # Exclude /assets and /manager directories from rewrite rules
        RewriteRule ^(manager|assets) - [L]
        
        RewriteRule ^en/assets/(.*)$ assets/$1 [L]
        RewriteRule ^fr/assets/(.*)$ assets/$1 [L]
        
        # Redirect from mydomain.com/rootname to mydomain.com/rootname/
        RewriteRule ^en$ en/ [R=301,L]
        RewriteRule ^fr$ fr/ [R=301,L]
        
        # The Friendly URLs part
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^en/(.*)$ index.php?q=$1 [L,QSA]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^fr/(.*)$ index.php?q=$1 [L,QSA]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


        And it behaves normally.
        Weird, because this rule
        RewriteRule ^(manager|assets) - [L]
        normally tells apache not to rewrite path starting by manager or assets. Work for manager indeed...

        If anyone has a better solution?
          • 21778
          • 223 Posts
          YAYI!

          Thanks a lot, seems to do the trick with maxigallery aswell!!

          Finally its all working laugh
            • 22851
            • 805 Posts
            Thanks a lot for your help @nicpan. That’s a fairly simple workaround for the problem.

            I’d still like to work out where these extra /en/ or /fr/ directory prefixes are coming from though. I’ll keep it on my list of things to investigate and get back to you if I find a better solution to the problem.

            PMS
              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.
              • 21475
              • 80 Posts
              U’re welcome wink
              thx to you, you did an incredible work in turning modx into an easy multilingual solution!