We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
    Hmm.. the gallery behind that link doesn’t work at all for me.. There’s no picture width and height outputted to the image links, eg they are:

    <a href="javascript:void(0);" onClick="javascript:showPic('/assets/galleries/4/1blouse-pink-flower.png','','',,);return false;">


    That gives javascript error as the last two parameters from the showPic function call is missing. Actually, the size parameters are outputted to the last image of the gallery and that’s why it works. But the sizes are missing from the other images.

    The link is built like this in the template:

    <a href="javascript:void(0); "onClick="javascript:showPic('[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]','[+maxigallery.picture.title:htmlent+]','[+maxigallery.picture.descr:htmlent+]',[+maxigallery.picture_width_normal+],[+maxigallery.picture_height_normal+]);return false;">


    So that would mean that the following template placeholders are not working for you somehow(?): [+maxigallery.picture_width_normal+] and [+maxigallery.picture_height_normal+]

    Those parameters require that the following returns true when gallery images are processed:

    file_exists($modx->config[’base_path’].$mg->path_to_gal.$pics[$i][’filename’])

    And that getimagesize() php function is working. Don’t see why it shouldn’t work.. And where does the image width and height come for the last picture?

    You could try to use just the [+maxigallery.picture_width_normal+] and [+maxigallery.picture_height_normal+] parameters in some template and see if they return anything.. Or go with the v0.6 test version, it might have some fixes that you need. What is the problem with v0.6?



      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 16680
      • 73 Posts
      Hi Doze, thanks for your answer..

      Since I kept hitting a wall whenever I tried making this work, I then made a small flash gallery as a temporary solution until I had time to look at it again. Now Im sitting here again, having just tried to re-create all the chunks but still I can’t make it work. I can easily display big images from thumbs where no data has been entered in the Title or Description field. But the thumbs that has a Title or Description just won’t show when clicked. And I can’t even produce any Javascript errors or anything that can help me solve this.
      Simply nothing is happening.

      Thanks, larsb
        Signature on it&#39;s way
        • 7923
        • 4,213 Posts
        Do you have html code in those fields and you are not using :htmlent phx modifier? That can break the js code what it produces.

        Do you have a sample page for me to look at?


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 16680
          • 73 Posts
          Hey Doze, thanks for a fast reply.

          You can view the code at http://dev.ziestha.dk/kids

          No I am not using any html, but am using the htmlent modifier. You can see and example of my code below:

          mgGalleryPicture
          <li>
                 <a href="javascript:void(0);"
          onClick="javascript:showPic('[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]','[+maxigallery.picture.title:htmlent+]','[+maxigallery.picture.descr:htmlent+]',[+maxigallery.picture_width_normal+],[+maxigallery.picture_height_normal+]);return
          false;">
                         <img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]"
          class="thumbnail" title="[+maxigallery.picture.title:htmlent+]"
          alt="[+maxigallery.picture.title:htmlent+]" />
                 </a>
          </li>


          Is that any help?

          thanks, larsb
            Signature on it&#39;s way
            • 7923
            • 4,213 Posts
            It’s because you have line changes in the text. This is what comes to your html source from maxigallery:

            <a href="javascript:void(0);"
            onClick="javascript:showPic('/assets/galleries/4/dress_black-white_stripes.jpg','Kjole Sort-Hvid jersey','Str:1-6 år
            Kvalitet:100% bomuld
            Vejl. Udsalgs pris 399,-',450,300);return
            false;">
            


            So the javascript get’s broken on a multiple lines. You can either write your text into single line or create a snippet called "phx:slashandstrip" with the following content:

            <?php
            return addcslashes(preg_replace("~([\n\r\t\s]+)~"," ",$output), "'");
            ?>
            


            And in your "mgGalleryPicture" template, replace :htmlent with :slashandstrip in the onClick attribute value.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 16680
              • 73 Posts
              Hey Doze, thanks for you answer. That worked like a charm right away.. *kneeling and confessing to the Dozeionism straight away*

              So when using MaxiGallery like this, there is then no way to have the information in the description field on separate lines? Or would I then have to create a custom field for each line? Which I’m not really up since I’m just happy to finally get it working..

              thanks, larsb
                Signature on it&#39;s way
                • 7923
                • 4,213 Posts
                Try using
                in the title field instead of enter.


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 16680
                  • 73 Posts
                  Hi Doze, thanks for answering.

                  Im afraid that the
                  simply gets outputted on the page as the rest of the information.

                  thanks, larsb
                    Signature on it&#39;s way
                    • 7923
                    • 4,213 Posts


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."