Make Categories = Structures? #9781
-
There could bits I am missing, but it seems that Categories are just Structures with less features.
I've found the difference can be hard for clients to delineate, which is understandable. I'm wondering if something should be done to make this clearer. e.g:
|
Beta Was this translation helpful? Give feedback.
Replies: 19 comments 20 replies
-
The main difference is in how they get related to entries. When you relate a nested Structure section entry, that’s the only thing that gets related. When you related a nested category, its parents get related as well. But yeah, I’m sure there are cases where it would make sense for categories to have authors; there are cases where entries shouldn’t have authors. Etc etc. For now we’ve just given each element type the features that they most commonly have in other systems. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the explanation - Auto-relating parents for categories is definitely something I wasn't considering.
Just spitballing - Since what you're describing is more a characteristic of the Entires/Categories field, if one were looking for more parity between Structures & Categories, a field setting of "Relate structural parents?" might work as well.
Indeed. Run in to that before. In the future, perhaps both categories and sections could have the options:
|
Beta Was this translation helpful? Give feedback.
-
Yeah realistically I’d rather just merge the two concepts, rather than duplicate a bunch of entry features for categories and vise-versa. But I wouldn’t want to merge the concepts until we can come up with a way to customize how the "entries" / "categories" can be displayed for content managers (e.g. #1662). |
Beta Was this translation helpful? Give feedback.
-
Thanks - subscribing to that thread. |
Beta Was this translation helpful? Give feedback.
-
I wanted to propose the same thing, so thanks @timkelty for the issue. We’re facing the dilemma of deciding whether to go with categories or entries on every Craft install. Currently we have to make the decision based on the way the associated relations field type works, or if a field layout select (entry types) is ever needed, and we usually end up with elements used for classification in both places, obviously bad for content managers. @brandonkelly don’t you think customizable sources view in the entries index is good enough to implement this request before #1662, which is probably still a good time away (considered for 4.0). |
Beta Was this translation helpful? Give feedback.
-
@carlcs Realistically we’re not going to drop a major concept like Categories outside of a major release cycle (and 3.0 GA is way too close for us to consider it for this one). That said, if there’s anything you’d like to see us do to make using Structured entries a more viable replacement for categories in the meantime (e.g. allow Entries fields to be more like Categories fields), feel free to post those suggestions as separate issues. |
Beta Was this translation helpful? Give feedback.
-
@brandonkelly understandable. And a good idea with making the Entries field type more advanced as a first step. Thanks |
Beta Was this translation helpful? Give feedback.
-
Yep - if we wanted it as a 3.0 feature, I'd say the biggest thing would be an option to "Include ancestors when related". Only question then is - is that an option when creating a Structure section, or just a field option for Entries fields. I'm guessing the latter would be most flexible, and maybe easier to implement as well. |
Beta Was this translation helpful? Give feedback.
-
Yeah seems like the obvious place to put it is in the Entries field settings. |
Beta Was this translation helpful? Give feedback.
-
@brandonkelly FWIW, here's what my plan has been: Make a new "Enhanced Elements" field typeThis would be a catch-all replacement for all applicable element types, with additional field options to address the ancestor selection issue, as well as several other enhancements:
While it is on my "someday" list to implement this as a plugin, I think having the ability for plugin devs to automatically register their entry types is a good reason this should be implemented in core. For example, Field types like Freeform Form would no longer be necessary. Another cool concept would be that a plugin dev could register a new element "view type" UI, that would become available when installed. E.g. - if the above were implemented w/o a "Checkboxes" view type, I could write a "Simple Element View Types" plugin, instead of having to make various field types: "SimpleCategories", "SimpleElements", etc. |
Beta Was this translation helpful? Give feedback.
-
Hi there, I see this looks to be on the 5.0 milestone, which I understand as it is a major core concept to be changed. But... are you planning on adding an "include ancestors on selection" option to the structures field (on a 3.x or 4.x release) before replacing categories entirely in 5.0 so we can use them as a full replacement to categories and benefit from their added power (multisite I'm looking at you)? In core or via plugin. Or maybe I missed a plugin that exists already? Just a quick update on this to know where you stand would allow us to adapt accordingly. Thanx ;) |
Beta Was this translation helpful? Give feedback.
-
@JeanLucEsser both issues (this one and #2632) are on the same milestone list right now. It looks like Entries field updates won’t make it into a Craft 3 release in the end. |
Beta Was this translation helpful? Give feedback.
-
@carlcs yes that's what I thought. So in the meantime I guess I'll use structures because I need multisite ability, but I'll add a query to find all descendant ids of the structure parent's entry before querying the content related to all those ids. Guess it's the best way to go for now. The real downside is having no visual cue of the ancestors tree for the selected entry in the structure field. Which by the way I find it to be an issue even when using structures as intended with no relation to ancestors, as it could be useful information. But it's tricky to implement, as each entry should be independent and able to be re ordered... maybe on hover or something... anyway, not the subject at hand, I digress. Thanx anyway for getting back to me. Much appreciated. |
Beta Was this translation helpful? Give feedback.
-
I agree with what you said about the label of entries in the entries field. In structures the title isn’t always enough info for an entry to be recognizable. |
Beta Was this translation helpful? Give feedback.
-
Sorry this is actually intended to be part of 4.0. Just fixed that. |
Beta Was this translation helpful? Give feedback.
-
I am wondering if this Is this still valid for 4.0, because categories still exist in Craft 4 beta 1. |
Beta Was this translation helpful? Give feedback.
-
@timkelty Hey just following up to see if there's any concrete plans yet to add category like relationship logic to entry fields? Currently we're stuck using categories because it's very important for our site that various elements are related up the tree, and it's helpful that the category fields shows the relationship up the tree. However it's concerning for our content team that categories don't support revisions like entries. |
Beta Was this translation helpful? Give feedback.
-
We have decided to move forward with this. Categories, tags, and global sets are all going to become entries. Here’s how it will play out: Craft 4.4
Craft 5
Craft 6
|
Beta Was this translation helpful? Give feedback.
-
We discussed this internally and had some concerns about how stuffing categories in the Entries sidebar along with the other sections is going to impact the author experience. We have a number of sites with upwards of 20 category groups. I'm all for converting them to sections/entries; however, scrolling through tons of sections is going to be tough to convince clients is an improvement. One idea might be to convert categories to entries "behind the scenes" until the new unified content view is ready. Perhaps this could be facilitated with a checkbox or toggle in the section settings. As long as this was enabled, these sections would remain fenced off as categories-in-name-only, but they'd use the same templates and logic as entries. |
Beta Was this translation helpful? Give feedback.
We have decided to move forward with this. Categories, tags, and global sets are all going to become entries.
Here’s how it will play out:
Craft 4.4
Craft 5