We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48099
    • 2 Posts
    I just installed Revolution and am in the process of converting a template.. when I insert the below code instead of putting the proper image url it prefixes it with the base DIR twice... so the below code generates: http://alittlesoapybusiness.com/modx//modx/assets/gallery/1/1.jpg instead of http://alittlesoapybusiness.com/modx/assets/gallery/1/1.jpg

    In my main template I have:
    [[Gallery? &album=`Front Page Slider` &thumbTpl=`Flex-Slider`]]


    So when using this template:
     <li>
      [[+url:!empty=`<a href="[[+url]]">`]]<img src="[[+image_absolute]]" alt="[[+name]]" />[[+url:!empty=`</a>`]]
      [[+description:!empty=`<p class="flex-caption">[[+description]]</p>`]]
    </li>
      • 41970
      • 79 Posts
      I had the same issue many times, but now can't remember how I fixed it, but I think it has something to do with your base_url. How does your "Resource path" in the system settings look like, did you change it or leave it empty? Or did you set up custom Media Sources, if yes, how does the basePath look like?
        • 48099
        • 2 Posts
        Quote from: bblinda74 at Jun 22, 2014, 12:13 AM
        I had the same issue many times, but now can't remember how I fixed it, but I think it has something to do with your base_url. How does your "Resource path" in the system settings look like, did you change it or leave it empty? Or did you set up custom Media Sources, if yes, how does the basePath look like?

        The Resource Path and URL is blank and I never set up any custom media sources [ed. note: dreded last edited this post 9 years, 10 months ago.]
          • 42339
          • 5 Posts
          I'm having the same issue after moving a site from the live site to local development site on MAMP. For my MAMP install, I have the modx root/install in a subfolder. It is accessed by going to http://localhost/sitename. So in my config.inc.php file I have $modx_base_url= '/sitename/'; instead of just $modx_base_url= '/';. And updated the other URLs accordingly, too. For example, $modx_assets_url= '/sitename/assets/';.

          The live site is fine. But, I'm wondering what the issue might be. Perhaps there are issues when the site is in a sub folder/directory?

          dreded, have you found the solution?
            • 52460
            • 1 Posts
            I know that this publication have much time but I'm having exactly this problem. someone could solve this problem?
              • 47850
              • 3 Posts
              I solved this in the following way. No idea how good this solution is, at least it works for me.

              [[!Gallery? &toPlaceholder=`gallery` &thumbTpl=`getImageProperties`]]
              [[+gallery]]


              Create Chunk getImageProperties:
              [[!getImageProperties? &album=`[[+album]]` &filename=`[[+filename]]`]]


              Create Snippet getImageProperties:
              <?php
              /**
               * PROPERTIES:
               * 
               * &album required
               * &filename required
               * &gallerypath optional. Default: assets/gallery/
               *
               * USAGE:
               *
               * [[!getImageProperties? &album=`[[+album]]` &filename=`[[+filename]]`]]
               *
               */
              
              $album = $modx->getOption('album', $scriptProperties);
              $filename = $modx->getOption('filename', $scriptProperties);
              $gallery_path = $modx->getOption('gallerypath', $scriptProperties, 'assets/gallery/');
              
              if (!isset($scriptProperties['filename']) || !isset($scriptProperties['album'])) {
                $modx->log(modX::LOG_LEVEL_ERROR, '[getImageProperties] missing required properties &album and/or &filename!');
                return;
              }
              
              $image = $gallery_path . $album . "/" . $filename;
              
              $tpl = $modx->getOption('tpl',$scriptProperties,'exceptionAlbumTpl'); 
              $output = $modx->getChunk($tpl,array('full_image' => $image));
              return $output;


              Create Chunk exceptionAlbumTpl and if necessary, adjust the path to the gallery files:
              <a title="[[+name]]" href="assets/gallery/[[+album]]/[[+filename]]">
                <img class="albumItem" src="[[+full_image]]" alt="">
              </a>