3

I'm building a boutique website using Kirby (a flat-file CMS) and I'm looking for a way to structure the site for best performance and maintainability.

The website will have multiple categories and under those categories, it will have subcategories. It will only go a max of two levels deep.

Example of current structure:

Categories
    Dresses
        Prom
            Dress-1
            Dress-3
            Dress-4
            Dress-8
        MOB
            Dress-3
            Dress-8
            Dress-9
        Homecoming
            Dress-1
            Dress-10
        Quincenera
            Dress-2
            Dress-8
        Party
            Dress-1
            Dress-10
            Dress-8

    Jewelry

    Accessories

As you can see, some dresses will repeat for different dress categories. Each dress is contained within it's own folder which contains it's images and a text file that has information about the dress such as the title, price, colors, and sizes.

I would like to structure it in such a way that I'll be able to add a dress to multiple categories without slowing down to site (at least not by much) when browsing by category in the frontend. Since I do not have much experience in flat-file systems, I'm asking you for help.

What is the recommended way of structuring this site?

Thank you.

  • 1
    I'd start by thinking about the URL structure before trying to map your design to the file system. Your current design seems to list the same dress under multiple URLs, which may be problematic from a SEO perspective. I'd have a folder full of dresses, and a folder full of occasions. Occasions and dresses then link to each other. In a blog, this would be equivalent to blog posts and tags/categories. Another advantage of this is that each occasion page can serve as a landing page for customers with tailored anchor text, and can advertise suitable dresses together with matching accessories. – amon Sep 7 '16 at 7:39
  • 1
    Why are you not using a database for this? It seems like a restriction that's pointing you in the direction of doing terrible things – Daenyth Sep 7 '16 at 19:43
  • @amon I did, that won't be a problem since I can use routes. I structured the site as @ CandiedOrange suggested and with suggestion urls would be something like site.com/shop/dress-name but with routing I can always add the category and since dresses are in multiple categories, I believe with routes it'll be much easier to have multiple urls for dresses that fall under multiple categories. – Buzzer Sep 8 '16 at 17:15
5

Don't use folders as tags.

Don't cram it into a tree structure if it isn't a tree.

A dress shouldn't need to live in two folders because it can be worn at different kinds of parties. Each dress should live in one place.

A tagging system might be the way to go.

Kinds of parties might know where to find their list of dresses.

Or dresses might know where to find their list of parties.

Or a list joining both together might exist. In the database world this relationship is called many to many. There we give the relationship it's own table.

You can make this work with flat files but please don't do this to a file system. Symbolic links or gads shortcuts might make it less evil but this isn't sort of problem I'd ask the file system to solve.

  • 1
    Thanks for the advice. I ended up switching up the structure as you suggested without much performance loss. Some heavy caching should fix any performance loss. Thanks again. – Buzzer Sep 7 '16 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.