We're trying to setup a category field type to allow the selection of 1 category but from multiple category sources. Is there a simple way to achieve this without writing a custom plugin / fieldtype?

Currently we've set up 4 Category fields to allow a selection from the 4 sources with instructions to only use one of these fields at a time but it feels messy. Thanks!


You could use entries instead of categories. Create four structures and use them instead of your category groups. Your category field will actually be an entry field, and it can pull from the four structures, with a limit of one.


You cannot allow selection from multiple category sources in a category field.

I would keep the 4 category fields but set each field to limit to one (1) category selection.

Then, when you add the field to the field layout, make the field required to ensure they select a category for each field.

  • Hi Luke, thanks for helping out. The trouble with that is that only want 1 field out of the 4 to have input. and the other 3 empty. ie. a total of 1 category selected across the 4 fields rather than 1 category selected for each field.
    – Tchick
    Sep 8 '15 at 16:19

What are your 4 sources used for? Depending on your content you might be able to work around it.

There's no exact science to this but in my experience doing IA, here's a few thoughts on category sources:

  • I like to set mine up so they kind of match the sections I'm posting in. If you have to reach across multiple category sources for a field—say you only have one section throughout the site—it's possible your top level sections aren't specific enough.

  • You might be using categories that really shouldn't be categories. Like on a news site, Breaking News could very well span across everything. In that case, you'd be better off setting up a new field, say a checkbox, and allowing your authors to tick it as appropriate.

  • If you're coming from something like WordPress where you only had categories and tags to use out of the box, you can fall in that trap. Along the same lines, if you wanted to put something on the home page, you might have used a "featured" category that only shows up on the home page; a better, Craftier way is to use its relational magic and setup a field on the home page entry itself.

  • Category sources are hierarchical so you could merge the ones you need into some kind of catch-all category as needed. Categories should be relatively shallow. If you have like 50 categories for a smaller site, you're doing it wrong. It sounds like you have categories that are of varying topics. That can be a nightmare anyway you slice it.

As Luke mentioned, you can set it up so only 1 category can be selected. I would also look at how your 4 category fields are labeled. If you have labels like "Main Category" and then "Sub Category", it's probably OK that someone leaves the second and 3rd fields blank, for example. So the first could be required as a general "gist" of what the topic is, more less drilling down specificity.

  • Hi, thanks for your helpful and considered answer. The scenario is a shop whereby we're using categories to assign "collections" of products, admin specified "price bands", "lead-in time" and type of product. Each is a category that is also used as a filter mechanism on the front end. We're building a landing page for the shop with UI elements that link through to category pages - whether that's a "price-band", "type of product" page etc.
    – Tchick
    Sep 8 '15 at 16:22
  • We want the admin to be able to specify which category the panel links through to - which means selecting from a category field type, but ideally from the 4 sources not just one. Hence the tangle. In your first point I think you mean that I should try lumping related category sources in a single parent category and then specifying that as the source? That could work...
    – Tchick
    Sep 8 '15 at 16:25
  • Yeh exactly. Twig and Craft is extremely flexible when it comes to relationships so whatever you decide to do you can likely make it work with the right query. Sep 8 '15 at 22:32

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.