Grow your CSS skills. Land your dream job.

Image Galleries using Cycle.js and Kirby CMS

  • # May 30, 2013 at 11:27 pm

    Hi, I’m using Kirby for the first time and it’s pretty sweet. I’m currently running into a little snag and was hoping someone here could help.

    I’m building a portfolio site for a designer, and I’m trying to build the gallery pages. The folder structure for the site is like this:

    content/
    01-music/
    01-project/
    01-image.jpg
    02-image.jpg
    03-image.jpg
    02-project/
    01-image.jpg
    02-image.jpg
    03-image.jpg
    02-logos/
    01-project/
    01-image.jpg
    02-image.jpg
    03-image.jpg
    02-project/
    01-image.jpg
    02-image.jpg
    03-image.jpg
    03-advertising/
    01-project/
    01-image.jpg
    02-image.jpg
    03-image.jpg
    02-project/
    01-image.jpg
    02-image.jpg
    03-image.jpg

    On music.php, logos.php, and advertising.php I’d like to dynamically pull in one project’s contents at a time and allow the user to select a different project to view by clicking different links in a sidebar. I’d like to accomplish this without refreshing the page if possible.

    I’m also going to only show one image at a time from each project using the cycle.js plugin, and hide the rest until the user selects previous or next.

    Here’s the php that I have pieced together so far to retrieve the project images, but currently it only seems to be retrieving the last project in each subfolder:

    # June 1, 2013 at 7:10 am

    The problem is that you are calling all of the projects `xx-project`. Give them a different name (eg. `01-project-one`, `02-project-two`) and your code will run fine.

    # June 2, 2013 at 12:17 pm

    Thanks Ben! That got it to load everything perfectly!

    # June 11, 2013 at 11:51 am

    I hate to resurrect this question, but I’m still having a little trouble getting what I want.

    I need the images from each project to only load when the user clicks the relevant link in a sidebar.

    My current code is pulling in everything, which is a good start, but I’m not sure if I need to create a unique php file for each project or if Kirby can do it dynamically somehow.

    Thanks again!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".