1

I have a challenge that I'm struggling to figure out a good solution for. I have a client that sells jewellery & gifts. They are categorised into brands and types, so I might have:

  • Brand A Rings
  • Brand A Pendants
  • Brand B Rings
  • Brand B Pendants
  • Brand C Rings
  • ... etc

They have brand pages where every relevant type is listed under each brand, and want to be able to select a representative image for each brand type (so, two combined categories):

  • Brand A Rings [manually selected image]
  • Brand A Pendants [manually selected image]
  • Brand B Rings [manually selected image]

At the moment I've come up with a 'showcase' category so I look for products categorised as 'showcase', and then use them within the brand page. However, this isn't that satisfactory as it's a clunky process to add the category, and there's no management of old showcase products etc.

I'm trying to think of a more visual way to handle this that won't also introduce too much of a performance impact in terms of queries when I come to pull it all back together in the UI. Because I'm working with category combinations, I'm finding it quite tricky... I'm just wondering if anyone else out there has tackled a similar problem, or if there's a 3rd party add-on that I don't know about. I thought about Low Variables, or Channel Images, but I don't think either of them will help.

  • I just wanna check if I understood it right. Are brands and types two different category_groups? – Robson Sobral Jul 22 '13 at 16:51
  • Yes, sorry, I should have made that clear. So I have a group for type (ring, pendant, etc) and another distinct group for brand (brand a, brand b etc). So I have entries with category combinations like (brand a - ring), (brand b - ring)... etc – BellamyStudio Jul 22 '13 at 19:23
1

I think you should use a status.

Set the status of products as "showcase" and add a fieldtype to its showcase photos.

Since you can't sort entries by status, you can use two channel:entries modules.

{exp:channel:entries channel="products" limit="1" status="showcase"}
    <div class="item">
    [...]
    </div>
    {embed="products/.list" showcase_product="not {entry_id}"}
    {if no_results}
    {embed="products/.list"}
    {/if}
{/exp:channel:entries}

And, on an embed:

{exp:channel:entries channel="products" limit="10" status="showcase|open" entry_id="{embed:showcase_product}"}
    <div class="item">
    [...]
    </div>
{/exp:channel:entries}

Of course, this way the showcase entry will be the first one on a list. You can just grab the first showcase item to change a background or a header and list your entries normally.

I set the status parameter on embed as both "open" and "showcase" in case the user forget to change some entry back to the open state.

You can use sticky_entries too, but they can make some mess on other lists around the website.

| improve this answer | |
  • Hey that's an interesting idea. But is it better than using a third category I wonder. It's more obvious in the CP, that's for sure, which is an improvement already. Thanks Robson! – BellamyStudio Jul 22 '13 at 20:09
  • I improved it a little, @Penzizzle – Robson Sobral Jul 22 '13 at 20:20
0

Since you mentioned that the images are "manually selected," maybe it'd be effective to focus on making the manual selection process easier, rather than on the data mapping from brand + type to an image?

For example, could you have an entry in EE for each brand page, and within that entry, a Matrix field that allows the editor to select both the type name and a product image? Something like that would be easy and efficient to output on the brand page.

I like doing this kind of thing, because it makes all of the relationships very explicit and easy to "manually" manage. But, if you have a lot of things (types, images) and/or editors who need the content to be much easier to access, this might not work.

Another idea, that "pulls" images from the Product entries:

In the product entries themselves, add specific products to a category named "Representative" (and, if necessary, have a separate "representative image" field). Then, in your template, pull entries that match brand & type & representative. E.g.,:

category="3&7&8"

Might either of those approaches work for you?

| improve this answer | |

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.