Do categories have any technical/functional background or are they only for visual organization?
(just found out, I can’t have two same-named chunks in different categories)
They organize TVs within tabs on the resource page’s TV tab. So possibly it could be a conflict if you created two similar categories then tried accessing a resource where these two categories would be called. Since they don’t get a unique ID, it could be a redundancy call?
In Revolution, they are also used for security permissions.
You can hide or show elements in a particular category based on the user group the user belongs to.
In the future, they may also be used to fine-tune Form Customization rules and apply them only to elements in certain categories.
I think, it would be cool if there was some kind of "scoping" so you wouldn’t need to have long and unique names (such as mytemplate_mypagetype_myarea) for all TVs and chunks.
-
☆ A M B ☆
- 2,475 Posts
Hmm.... from a database standpoint, it makes good sense to require a unique key for the name of each name, so I can understand the current limitations. Maybe it would be possible in the future to prepend the name with a prefix, or in MySQL to use a multi-column key. Taxonomies in MODx in general are still developing, so I suspect there will be a better organizational tool eventually.
Well, from what I’ve seen so far, these tables already have a numeric primary key that can be used for unambiguous identification.
There would have to be an algorithm going up the category hierarchy and returning the first match for a name.
From a performance standpoint the algorithm should run at save-time rather than view-time, from a standpoint of complexity/database space probably the other way round.
But maybe I’m just building cloud-castles and this is technically unrealistic.
-
☆ A M B ☆
- 2,475 Posts
Yes, the tables include an integer primary key, but that’s not usually how those items are called. A Chunk is called via its name, e.g. [[$myChunk]], not [[$123]]. Any algorithms could compound to significant calculation-times, so your idea of doing it when an item is saved is a good one: that’s how hierarchical URLs are calculated I believe. I’m having trouble mentally imagining what the database query would have to look like if the query had to figure out which category a given chunk was in: when the chunk is called, it’s called by its name alone, regardless of what category it’s in.