Forum
Need ideas for efficient use of Categories/Relationships in Runway
I'm building a Runway site for a home building company. I have two collections, Homes and Neighborhoods, both of which have list/detail pages. On my homes list page, homes can be filtered by categories such as number of bedrooms, bathrooms, etc. I also need to be able to filter homes based on which neighborhoods they are in. Similarly, on my neighborhood detail pages, I need to list the associated homes as well as the unique home price for that neighborhood.
I need to:
- Associate each home with one or more neighborhoods
- Assign a home price for each associated neighborhood
- Filter by associated neighborhoods on the homes list page
- Show associated homes and prices on the neighborhood detail page
If it weren't for the unique prices attached to each home/neighborhood combination, I could simply create a Neighborhoods category and use that to filter. How can I also associate a price with the related homes/neighborhoods?
Thanks for the ideas!
- Shane
This is the part I don't understand:
Does that mean a home can be in more than one neighbourhood somehow?
Yes, these are home plans. The same home can exist in several neighborhoods, but is priced differently in each one.
So does the price exist on the relationship?
That's what I'm not sure about. I know I can use Relationships to satisfy most of these requirements, but I'm not sure how to add the price into the mix. I can relate a home to several neighborhoods, but how can I also associate a price with that home/neighborhood relationship?
I can think of other use cases for this, especially with Shop. Say I have a collection of products and a "colors" category. In the product item I select the available colors so that the products can be filtered by color. But say the price of the item is dependent on the color...how can that price be added to the product/color combination?
In Shop those are product variants. You'd create an option for colour, and then option values for each colour. When colour is set as an option for the product, each combination is created as a variant with its own SKU, and its own properties such as price.
That sounds great. Do you think it would make sense to use Shop in this situation, without the ecommerce features?
No, I don't think this sounds like a good use for Shop at all. That wasn't my suggestion - I was just answering your question about Shop.
Any idea how I might achieve similar functionality without Shop?
At the moment you can't add any content onto the relationship itself. I'll have a think about it, but I'm not sure what the right solution might be.
Understood, thanks.
Still working towards a solution for this, but I've hit a wall and could use some help.
I've created Neighborhoods category. In my Neighborhood template, I select the category like this:
In my Home template, I also select a Neighborhoods category:
On my neighborhoods detail page, I get content like this:
Now what I can't figure out is how to get the category of the matched Neighborhood detail page item, and then display items from the Homes collection which match the same category. I tried this:
but that doesn't work because $result[0]['neighborhood'] is an array of category IDs. How can I get the category slug of the current item so that I can filter another collection with the same category?
Nevermind, got it working with a combination of categories and repeaters. Thanks.