We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13331
    • 67 Posts
    Hello,

    I’ve run in to a bit of a problem... I’m doing a product catalog site for a client.

    When you open a site that shows a product. The following will show:

    -An image (TV)
    -Image description (TV)

    -Product description (main content)

    Besides that within each category of products I have a "See all" page that shows all the images from each product (via ditto).

    ....

    Now my client wants to have the possibility to link the image to a larger image.. but not on every product.

    My first thought was to assign a new image TV to the template and do a link wrap on the initial image TV and then rename the two TVs to "img small" and "img large" and then in the template write:

    <a href="[*img large*]">[*img small*]</a>


    But then if I have a product where the client does not assign a large img and the client only wants to show the small image, an active link will still show just leading to a blank page.

    If I just let the client add the image in the main content and assign the link manually, my "Se all" page with the ditto call doesn’t work.

    Can anyone please help me sort this out?

    Thank you..
      • 3749
      • 24,544 Posts
      I’m sure someone will have a better answer, but I’d be inclined to just use MaxiGallery for the image uploads. It would be easy for your client and every pic. could have a thumbnail and a larger image (and, optionally,a third giant image). You can set the various image sizes to whatever you want and can apply effects like dropshadow and imagemasks masks automatically on upload.

      Since there would always be a larger image, you wouldn’t need any conditional code for products without a larger image.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 33982 ☆ A M B ☆
        • 476 Posts
        What I do for situations like what you’re describing is use a combination of PHP Thumb (http://phpthumb.sourceforge.net) which is great for resizing images (creating Thumbnails, etc.) and then for enlarging the image, I always use lightbox and PHP Thumb together. Here’s an example of a page on a site I designed where the client uploads their image through the T.V., then the thumbnail is created by PHP thumb. Then for resizing the image for enlargement, PHP thumb resizes the image and lightbox puts it up. See an example here: http://finelinewood.com/57.html ... most of the site has images resized and enlarged using this process.

        Now if the client doesn’t want the product to have a large image the visitor can click on, this is where PHx comes in handy (http://modxcms.com/PHx-1006.html). It allows you to set conditions. You may by default have:
        <a href="[*img large*]">[*img small*]</a>


        And by the way, are you having the client upload a small and large image? It would be easier to just have them upload the image (large one), and have it resized by PHP Thumb. In the example below, I’m going to assume we remove a T.V. for both a small and large image b/c only 1 is actually needed (i.e. [*image*]). Hope that makes sense.

        If you set a selection T.V. for this image, you can set a select box or radio options for the client to choose from for that image. So if the client doesn’t want for that image to be enlarged, you would have a T.V. they choose. Based on what they choose, PHx would output the appropriate code for example here:

        [*image_switch:is=`off`:then=`{{chunk_thumbnail_no_link}}`:else=`{{chunk_enlarge}}`*]


        If you are using PHP Thumb and lightbox as in the example link I provided above, the chunks would have the following value:

        {{chunk_thumbnail_no_link}} would have:
        <img src="assets/snippets/phpthumb/phpThumb.php?src=[*image*]&w=100&h=100&zc=1" alt="[*pagetitle*]" />


        {{chunk_enlarge}} would have:

        <a href="assets/snippets/phpthumb/phpThumb.php?src=[*image*]&w=700" rel="lightbox" title="[*pagetitle*]"><img src="assets/snippets/phpthumb/phpThumb.php?src=[*image*]&w=100&h=100&zc=1" alt="[*pagetitle*]" /></a>


        And by the way, why exactly do you need a whole other page to list out all the images? You can easily (using the info I provided above) have thumbnails listed out on the page with the product. Again, using PHx, PHP Thumb and lightbox, you can have it set so the client can have say for example 8 images. If they don’t need that many, maybe only 1, PHx can handle that. I can see a similar situation as to what you’re describing on another site I designed awhile back. The client wanted to be able to put up pictures of their property on the page itself (see here: http://rent2ownhomesonline.com/10085-Canyonwood-Lane.html) ... I set up 7 image T.V.’s for them to be able to upload the images. If they didn’t use all 7 (or only 1 for that matter), PHx would not output anything for that image.


        Hope that helps.
          Precision Web Development ... SmashStack.com
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Links and images on that page you link to for finelinewood are dimmed and don’t work on FF 3.01 Mac; the cursor doesn’t even change. The bottom menu is OK.

          Safari is fine.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 33982 ☆ A M B ☆
            • 476 Posts
            Dang it...I hate when new browsers throw things off...will fix that shortly...good looking out...thnx! I’m using a negative z-index for a background image and apparently FF3 is not rendering it correctly (or probably I just coded it wrong).
              Precision Web Development ... SmashStack.com
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              On the home page the main menu doesn’t work, but the sidebar images are OK.

              I see there’s a newer version of the Flash plugin; I’m installing it now and will see if there’s any difference.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 33982 ☆ A M B ☆
                • 476 Posts
                Yeh, it’s happening all over the site on FF3...when I designed the site, FF3 wasn’t out yet...at the time I tested on FF2 (Mac and PC), IE6 and IE7, Safari, Netscape, and Opera and they were all cool.  But I’ve got to correct some coding. So I guess for now view the site in anything other than FF3! wink
                  Precision Web Development ... SmashStack.com
                  • 7231
                  • 4,205 Posts
                  I have had a few older sites present some bug or another in FF3. Since they look fine in every other browser I am not sure if it is a bug that will be ironed out in a next release or something I should be concerned about.
                    [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                    Something is happening here, but you don&#39;t know what it is.
                    Do you, Mr. Jones? - [bob dylan]
                    • 33982 ☆ A M B ☆
                    • 476 Posts
                    Yeh, I was kinda surprised this happened with FF...with IE I understand, but I guess I didn’t expect this with FF.  Oh well, FF2 is still an awesome browser for web design with the Firebug plugin tool.

                    Oh and Jachobsen, sorry we strayed from your original topic...did I answer your question by the way?
                      Precision Web Development ... SmashStack.com
                      • 13331
                      • 67 Posts
                      How do I setup PhpThumb to work in modx?