I have a bout ten pages that look about 70% the same but each has its own sections that should have either their own
TVs or own layout. I want to create something like a base template then create other templates that include all of that content plus its own. Does this make sense? Is it easily doable?
Thanks Very much for any help on this.
bruce
-
MODX Staff
- 10,725 Posts
You can use Chunks to maintain common elements across all the Templates and then you can use Template-specific chunks to differentiate. Or, you could also define Template Variables to abstract the "layout" for each variation and use one Template (this is how I usually approach it). This layout Template Variable could be locked for editors and you could control it per Container (using @INHERIT) and/or for a specific Resource. Then your other Template Variables (and other Elements) can be placed where they need to go for each specific "layout", without having to maintain multiple complete Templates.
I’m sure others have additional approaches they can share.
-
MODX Staff
- 10,725 Posts
FWIW, PHx is great for filtering values and doing simple conditionals inside of most Elements, but using it in your Templates prevents caching of certain elements and can seriously degrade site performance.