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

    I am fairly new to modx, so bare with me.

    What I want to make is a site with a products page, with a thumbnail and a short description of each product in that category, which is created automatically from a product detail page, which the admin would set up. Can this be achieved with something like ditto and chunks?

    Also is there some way to paginate automatically after, say, 20 products on a page?

    I really just need some sort of starting point or some examples.

    Is this possible?

    Thanks
      • 21257 MODX Staff
      • 730 Posts
      timdiekman,

      Yep, Ditto would be perfect for that. It’s not much different than using it to summarize news articles. You’ll probably want to make a Product Template and add Template Variables (TVs) to it, depending on what kind of information you need available in your summary and detail page templates (eg. price, photo etc)

      (Note the distinction between MODx Templates, which give documents access to their TVs, and sub-templates, which are usually Chunks with placeholders in them. Ditto uses sub-templates in making it’s summaries, but you’ll find them referred to as templates, which might be confusing.)

      The most helpful stuff you’ll find on the Ditto site (http://ditto.modxcms.com/) will be the bits about making your own custom template (for your summaries) and about pagination.

      The main MODx documentation is pretty good at explaining TV - just know that when you’re making a Ditto sub-template, Ditto turns TVs of the documents you’re summarizing into special placeholders prefixed with ’tv’.. so if you have a TV called ’price’ in your product Template, and you wanted to show the price in your Ditto sub-template, you’d get it with: [+tvprice+]

      There are a million more things to say about this stuff.. I’m still learning best practices and finding new ways to accomplish stuff in MODx. Welcome and good luck!
        Mike Schell
        Lead Developer, MODX Cloud
        Email: [email protected]
        GitHub: https://github.com/netProphET/
        Twitter: @mkschell
        • 30011
        • 7 Posts
        Thanks a lot.

        I have heaps of reading to do...

        Cheers

        Tim
          • 33982 ☆ A M B ☆
          • 476 Posts
          My advice for the thumbnail images would be to use PHP thumb. That’s what I use to resize images to create thumbnails images in the exact dimension I want. You can download it here:

          http://phpthumb.sourceforge.net/
            Precision Web Development ... SmashStack.com
            • 21257 MODX Staff
            • 730 Posts
            Good suggestion flinx. It’s a great library. In fact, if you get PHx going, then you can also take advantage of maFF’s phpThumb package for MODx
            http://modxcms.com/phpThumb-Package-1522.html
            I’ve used it on about 5 sites so far, mainly for resizing and adding a bit of unsharp mask. I’m about to try watermarking with it.
              Mike Schell
              Lead Developer, MODX Cloud
              Email: [email protected]
              GitHub: https://github.com/netProphET/
              Twitter: @mkschell
              • 29525
              • 388 Posts

              Does anyone have an example of this implemented that we can see?

                www.terrybarthdesign.com
                • 21257 MODX Staff
                • 730 Posts
                Quote from: Terry at Jun 17, 2008, 07:12 PM

                Does anyone have an example of this implemented that we can see?

                1) http://www.stilettocreative.com/index.php?id=30
                Throughout the Work section of this site, the thumbnails and even the larger images in the lightbox are resized and sharpened by phpThumb from much larger source images uploaded by the client

                2) http://www.harperotc.com/inventory/
                Again, these thumbs are all resized from assorted sized larger images that the client uploads. (Please excuse that the page footer tends to ride up on the page.. the site is in transition to a new domain and the CSS problem has been fixed on the new site.)



                  Mike Schell
                  Lead Developer, MODX Cloud
                  Email: [email protected]
                  GitHub: https://github.com/netProphET/
                  Twitter: @mkschell
                  • 33982 ☆ A M B ☆
                  • 476 Posts
                  Does anyone have an example of this implemented that we can see?
                  I think I’ve used in on virtually almost every site I’ve done in the last year...it is such a powerful tool (you can scan my portfolio here: http://www.my619.com/portfolio). Here’s a site I just recently did that uses it a lot...check out the photo gallery to see it being used there along w/lightbox. Even the enlarged images in lightbox are resized w/PHP thumb.

                  http://finelinewood.com/

                  It’s also easy to create slideshows (http://modxcms.com/forums/index.php/topic,21197.msg131483.html#msg131483) using it w/a slideshow script you can download from Dynamic Drive (http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm). On the top of this site there is a slideshow. Each of these images are resized using PHP thumb as well (along with all the property images on the site):

                  http://pmtrial.com/
                    Precision Web Development ... SmashStack.com
                    • 29525
                    • 388 Posts
                    Thanks flinx for the references.

                    Great site by the way.
                      www.terrybarthdesign.com
                      • 33982 ☆ A M B ☆
                      • 476 Posts
                      Thanks flinx for the references.

                      Great site by the way.
                      Not a problem...thanks for the compliment!
                        Precision Web Development ... SmashStack.com