We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Share your thoughts and ideas about The Open Source Bespoke CMS and customizing MODx.
      Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. BlogTwitterLinkedInGitHub
      • 12236
      • 48 Posts
      Digital Butter - MODX Premiere Partners Reply #2, 13 years, 11 months ago
      The site being referenced was very cool - and very interesting to see the backend on something like that. Can’t see the client having any usability complaints at all.

      Here’s that link: http://www.hadleighsbespoke.com/
      • Would love to see the presentation/screenshots to see what Jeff has done.
          MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!
          • 4018
          • 1,131 Posts
          I’ll post some of the code later so you guys can roll your own solutions. Probably won’t post the javascript stuff cause all that can be viewed straight off the site...but the snippets and other MODx related stuff will definitely be posted. smiley

          Jeff
            Jeff Whitfield

            "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
            • 4018
            • 1,131 Posts
            Alrighty, guys, here’s the first beta of the EvoGallery module and snippet. Will work on getting some documentation out soon. In the meantime, play with it and let me know what you think. smiley

            I’ll be posting the other code soon. Just need to wrap up the necessary bits and post a quick explanation of what is what and where.

            Jeff
              Jeff Whitfield

              "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
            • yay...
              another gallery... laugh
              definitely will try this!
                Rico
                Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                MODx is great, but knowing how to use it well makes it perfect!

                www.virtudraft.com

                Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                Maintainter/contributor of Babel

                Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                • 4018
                • 1,131 Posts
                Ok, I’ve attached a zip that’s a basic dump of the various bits that went into creating the functionality of the homepage and a Looks page of the site. For those who didn’t make it to MODxpo, here’s a very basic explanation of how each of these pages was done:

                Homepage

                The homepage starts out with a basic set of div’s and a simple snippet to spit out the list of images to show within the jQuery Cycle instance:

                    <div id="homelooks">
                        <div id="homeimages">
                [!homepageLooks? &ids=`[*homeLooksOrder*]`!]
                        </div>
                        <div id="hometitle"></div>
                        <div id="homenav"></div>
                    </div>
                


                If you look at the homepageLooks.snippet.php you’ll see the basic snippet used. All we’re doing is taking the value of a TV called homeLooksOrder, which is nothing more than a comma-delimited list of the page ID’s that hold the information about the pics we want.

                On the backend, I took the homeLooksOrder TV, which is just a simple text field, and used a custom ManagerManager widget called Gallery Sorter to create a more elegant way of picking and choosing which images to show on the front-end as well as changing the order. With the widget in place, I can just enter in a rule in my ManagerManager rules:

                mm_gallery_sorter('homeLooksOrder','73');


                I tell it what TV field to change and what parent to look in for all the info about the images. If you investigate the default !template widget code and compare it to my code, you’ll get a good idea on how this was done. Lots of jQuery related stuff so if you’re not up to speed on jQuery, I suggest you do since ManagerManager widgets and functions are heavily jQuery based. smiley

                Looks page

                For the Looks page, the jCarousel jQuery plugin needed a JSON object array to feed the images to be shown. As such, I created a special EvoGallery call that spits out a JSON compatible array for a specific variable:

                [+phx:if=`[*template*]`:is=`9`:then=`
                    var lookscarousel_itemList = [
                [!Gallery? &display=`images` &type=`carouselJson` &itemTpl=`looks.carouselJson` &itemTplLast=`looks.carouselJsonLast` &sortBy=`sortorder` &gallerySortDir=`ASC`!]
                    ];
                    looksCarousel(lookscarousel_itemList);
                `+]
                


                Since I had to put this in the footer of the document, I added a PHx call that checks to see if the page is using a certain template. From there, I assign a lookscarousel_itemList js variable and use the Gallery snippet to spit out the data. After that, I fire off a looksCarousel function (see the hadleighs.js file for how this function works).

                Now, for a quick explanation of the snippet call...

                First, the display parameter tells it that I want to display the images associated with this page. You can also choose to display galleries if the page has children with images assigned to them. You can also choose to show a single image as well. (We’ll get to that in just a sec).

                Next, I set the type. EvoGallery allows you to set a configuration type, which is just a directory in the root of the EvoGallery snippet folder. In this case, I have a folder named carouselJson, which has the default templates to use for the wrapper, each individual item, and even which CSS and/or JS files to load. Since the JSON result can’t have a comma at the end, I manually set the templates for each item as well as the last item via a set of chunks.

                After that I set the order of the results to be based on the order set within the module.

                When you click on an image, you’ll notice that it brings up a detail overlay via some jQuery based AJAX. This is all based on a simple connector page that contains another EvoGallery snippet call that grabs the single image referenced by ID in the AJAX call:

                [[Gallery? &display=`image` &type=`hadleighs-detail`]]


                By default, calling a single image via the ’image’ display parameter expects a variable called ’picId’ using a standard PHP $_REQUEST variable. You can changes this to something else via the picId parameter.

                And that pretty much takes care of all the basic bits necessary within MODx itself to create this functionality. The rest is pretty much all wrapped up with my jQuery functions within the hadleighs.js file. Feel free to post questions if you get lost. smiley

                Jeff

                  Jeff Whitfield

                  "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
                • you mean [[EvoGallery?...]] ?

                  Ow, ok.
                  The second ZIP has a different snippet’s name. tongue
                    Rico
                    Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                    MODx is great, but knowing how to use it well makes it perfect!

                    www.virtudraft.com

                    Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                    Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                    Maintainter/contributor of Babel

                    Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                    • 4018
                    • 1,131 Posts
                    Yeah, I changed the name of the snippet after the fact. Felt like EvoGallery was better to avoid confusion with any of the other "Gallery" snippets on both Evolution and Revolution. smiley
                      Jeff Whitfield

                      "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
                      • 473
                      • 70 Posts
                      thanks Jeff, this is a souvenir from MODxpo