-
☆ A M B ☆
- 450 Posts
I feel like I’ve solicited opinions on this before, but I need a refresher course.
When working on sites that need to manage (query & display on the front end, CRUD on the back end) simple records, with less than a dozen fields, and without complex joins or other data relationships...
Is it acceptable to just create a custom template & TVs for the fields, and (optionally) use Form Customization to enhance the user-friendliness of editing these records... and just use getResources with a customized tplChunk for displaying them on pages?
Or is this really bad form? Should resources never be used for records that are not intended to stand alone as web pages? Is it a hack to do so? Or is it merely a practical solution within a very flexible CMF?
Interested in all feedback & opinions. Performance issues, best-practice philosophies, ease-of-maintenance concerns, and the git-r-done factor are all relevant discussion points.
-
MODX Staff
- 10,725 Posts
I guess I’ll use this as an opportunity to reiterate my philosophy in this area. MODX Resources are not intended to represent reusable content and/or data; they are for presenting unique views or services that can make use of reusable content and/or data.
Template Variables are IMO best used for organizing layout and presentation, not for storing data that you need to sort and search on. If your searching and sorting requirements are minimal, you can certainly get away with representing reusable content as a Resource; I would not say Resources should never be used in this way. But when scalability and performance are considerations, you are always going to be better off storing your data in a proper normalized fashion, using MODX Resources to access, search, sort, present, and/or manage that data as needed. MODX is optimized for creating layouts and abstracting logic from presentation. Using it’s generic structures to represent complex data relationships that need to be traversed in various ways will never be optimal.
-
☆ A M B ☆
- 450 Posts
Thanks for the concise summary. Makes a ton of sense.