What's the game plan here?

Hello all,

I’m more of a designer / front-end guy, but systems like Kirby give me the ability to provide more complex solutions. I still get tripped up when I have to put together a game plan for complex sites. I’m hoping you good folks could offer some insight.

I’m going to be building a site that functions very much like the product section of houz. My site will be offering only a tiny fraction of those products. I might not even use Kirby for this but wanted to reach out to this community because you folks have been very helpful in my Kirby dealings.

So if you view their products section you can drill down based on categories. But notice that you can further narrow down the results by using filters. See shot below. On the general Furniture category it only has a Style filter.

As you drill further into the categories there are more filters. See shot below.

How would you set this type of site up (generally speaking)?

You create a list of categories as pages, on the product page you assign a category or categories. on the products page you also fill in those bits of data that the site can filter such as attributes like style, material, etc.

But how do you display those filters. In the case of houz, assuming they use some thing like Kirby do you think they have different templates for category, sub category, sub sub category pages?

Overall how would you setup the product section of a site like houz if you were using Kirby?

Well, as much as I fell in love with Kirby and plan to use it for a ton of sites in the future, a complex webshop like houzz is not what it’s built for.

A project like that is still best done with a traditional, multi relational database – you need separate, but inter-connected tables for your products, categories, buying options, etc. and you need MySQL or similar to query it.

Recreating something like this in a purely text file based manner would be – in my honest opinion – a huge waste of time and resources.

But if someone has done something like this with Kirby alone – in an manageable amount of time – I also really would like to hear more about it.

1 Like

I agree. I’m going to use my other go-to CMS, Processwire. I’m asking this community for some guidance regarding how it could be setup in regards to templates, fields, and relationships. Even if it’s laid out assuming Kirby will be the CMS, I’d still get some valuable insight. And I could translate that to PW.

I have an open topic over there in PW’s forum but you folks are more response and have been very helpful in the past.

I would use Select-A-Structure to set up all your possible styles.

Each product would have the following fields:

Style (select or multiselect)

Price (number)

Discount (checkbox)
Free Shipping (checkbox)
From Europe (checkbox)
External Products (checkbox)
On Sale (checkbox)

So there are basically three kinds of filters we need in the controller/template code:

// Find products with modern style
$products->filterBy('style', 'modern');

// Find products with modern, vintage, or rococo style
$products->filter(function($product){
  if (in_array($product->style(), ['modern', 'vintage', 'rococo']) {
    return true;
  } else {
    return false;
  }
});

// Find products in a certain price range
$products->filter(function($product){
  if ($product->price() > 10 and $product->price() < 25) {
    return true;
  } else {
    return false;
  }
});

// Find products that match one of the checkbox fields
$products->filter(function($product){
  if ($product->freeShipping()->bool()) {
    return true;
  } else {
    return false;
  }
}

None of this code is tested. But hopefully it gives you a start. You could chain these filter functions based on the query.

I’m a great believer in the right tool for the job. Although there are options for turning a Kirby site into a store, it wasn’t designed to be one. That said, I’ve had great success adding basket / payment functionality to Kirby site using Snipcart.

If its real deep product categorisation and filtering you need I would suggest using a platform designed for this like Prestashop, Lemonstand or Shopify.

2 Likes

Actually, I think you can do what you want with the latest version of Statamic which is very similar to Kirby.

I have respect for statamic, grav and the like but they don’t fit into how I do things. I’m not interested twig or proprietary template engines that hide what php can do just fine. Furthermore those systems get all cranky when I try to do something outside their box. Processwire will be my choice here but they need a damn designer to bring em up to date. Whoa , I turned my reply into a rant. My apologies. And thanks for the input.

1 Like

Understood, my understanding of the new version of Statamic is that you don’t have to use that. It’s built on Laravel, so you can just write PHP. From the features page:

Built on Laravel
Extend Statamic with the full power of Laravel, or even integrate Statamic into your own Laravel projects. Win/win.

Whilst we all love Kirby here, there are some sites that other systems are more suited to. As others have said, I really think your going to banging your head on this one with Kirby.

Thanks for the reply.

I’m actually so invested in Kirby that I’m asking its community about how to use other content management systems for this. I do not plan to use Kirby for my project. This community is rather responsive and It’s valuable to see how folks would approach this if Kirby was the tool. The concept will translate (fields, templates, queries,…) to Processwire.

Samnabi has been very helpful in this regard.

Thanks all.

1 Like

It’s very possible to have relationships, like @samnabi suggested. Select-A-Structure and filters are indeed very helpful.

Another way would be to use the Controlled List plugin. You can use it to get for example page names from another custom parent. In fact, you have the complete control over the query with that plugin so you can get anything from anywhere.

If I would build something like this, I would be most worried about performance with many pages and many relationship, so keep an eye on that.

I think one of the main problems is the fact that each product can have different filter categories apart from the main categories/styles. It certainly doesn’t make sense to use many different blueprints for all combinations of filters, so the best way in Kirby would be to use a structure field (or a custom structure field variant) for those, so that you could freely add filters by type and value (I’d actually use a custom structure field that would predefine the possible types of entries (similar to what the builder field does).

The common categories that apply to each product would be realized with checkboxes or select/multiselect fields, as already outlined by @samnabi.