I have to build a website using the popular Expression Engine CMS.

I have managed to get my head around how channels and channel fields work. The problem I now have is that when an admin user adds a new product I would like for them to be able to select a retailer and then add a unique url for that retailer for the product.

Is this something that can be achieved using the Expression Engine CMS.

I had a look at Playa but I am unsure if this is what I need for this?

Many Thanks!


So the retailer has their own page, or the "unique url" lists all products by that retailer?

Playa is for linking entries, 1 entry to many. using it to link 1 to 1 is a bit overkill.

Based on the information provided, I say you want to use Categories. So that when creating a product, you assign it a category (and the categories are the retailers).

If the retailers have their own pages and not just used to group products, then you could just associate an entry in the retailers channel to the relevant category.

So "Joe Blogs Outlet" manufactures "Widgets".

Widgets is assigned the category "Joe Blogs Outlet" Going to /products/joe-blogs-outlet lists all the products from that retailer (this can be done a variety of ways, one of the easiest is to capture it in template group "products" and use the index template, then use Low Seg2Cat to identify the category in one of URL segments

The retailer category could have additional basic fields assigned to it to display details about the retailer in this instance.

But if you wanted the retailer to have their own "proper" page and EE entry instead of storing information in the Category fields, you could have another channel called "retailers", create an entry called "Joe Blogs Outlet" and assign it the same retailer category as the product, then you'll be able to link the product to the retailer and both will have their own entry.

Alternatively use EE relationships.

  • Thanks for this. I got my head around the relationships tool and it works a charm. I am only just starting out on EE so bit of a learning curve!
    – Neil Young
    Jul 25 '13 at 9:18

Ask yourself this:

(1) is a product likely to have a relationship with only one retailer, or multiple? (2) are custom category fields going to be enough to display what needs to be presented about each retailer?

If the answer to (1) is multiple, Playa will be your best bet (I've used it before even when there is only a one to one relationship because its filtering options are considerably better than a regular relationship field and the client has an easier time understanding it). And if (2) is no, channel entries are definitely the way to go, whether with Playa or a standard relationship field. Channel entries will give you longer term flexibility in what you present about the retailer(s), since you could add any number of amazing custom fields to deliver great information on the front end thanks to the extensibility of the fieldtypes from the community.

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.