racking my brain on this one!
Let’s say I have a product line…we’ll use bicycles for an example. Each bicycle is available in 10 colors; the same 10 colors across the entire product line.
I have generic color swatch images for each color (a green square, a red square, etc). These can be shared across the entire product range. On each bicycle model page, I have a grid/table showing all of the available colors.
That would be easy to do: just use an embedded template for each bicycle model.
THE HARD PART:
For some of the bicycles, I have an image of the color on a photo of the actual bicycle, and I’d like to show that instead of the generic color swatch. So some pages would show that same color grid, but if I have an actual photo of the bicycle in green, I’d like to show it instead of the color swatch.
I can’t think of a good way to do this. I could have a custom field for each color and manually load each and have some conditionals that say “if {green_img} exists, show {green_img}” but that’s not possible if there are hundreds of products.
Does anyone have any suggestions? I appreciate your brainpower and time on this one!
(edit: i’m attaching a very simple graphic to demonstrate what I’m talking about)
A quick approach: each bicycle is an entry in your channel, and each entry has custom fields; you leave them empty unless there’s a special image to show. In your template, you check for those custom fields and provide a default value if they’re empty. Makes sense?
it does make sense and I appreciate the reply.
I’m leaning this way unless I can come up with something different. The only problem to that approach is that I was hoping the custom fields for the bicycle would be a little more evergreen than that. For example, if the next year’s lineup has totally different color options, I don’t want to have “Bicycle Channel Fields 2016”, “Bicycle Channel Fields 2017” etc. Though that may be the only way to go.
Thanks again!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.