Hello everyone,
I’m new to MODx and really appreciate all the development work that has been done. It is really an excellent system.
I have a very basic question about MODx and the appropriate use of Template Variables (TV) and Templates (what you create in Elements -> Manage Elements -> Templates). I understand that you create a TV and then assign that TV to one or more templates. When editing documents using those templates, you’ll see widgets for viewing/setting these TVs.
I got that part.
In my mind, I feel I should be group TVs together depending on the context of the document. Let me illustrate with an example: let’s suppose I’m building a store website. I may have:
- static pages that talk about the store (so, no TVs used here, or maybe just something for sidebar content. Whatever.)
- dynamic-content pages for my products (so, that means a few TVs for product price, ID#, etc.)
- other dynamic pages, unrelated to my products pages (where I may want to use other, unrelated TVs)
Since there’s a whole set of TVs that only apply to the product pages, I feel this urge to separate these TVs into their own container. Perhaps create a different MODx template and assign my product TVs to that "product template" only. That way, when I’m in the context of creating some other static page or unrelated dynamic-content page, I’m not seeing these product-TVs that have absolutely no application in that non-product context.
And yet, duplicating a template just for the sake of grouping TVs according to context seems awkward. If I intend to have the same look over the whole site (static and dynamic pages alike), shouldn’t I be using just one template?
I’m confused. Help me understand: what is the MODx best practice for a situation like this?
Thanks in advance.