My site requires a number of templates, each of which share some TVs, but not others. Knowing that I would need getResources to for the rolling pages and in an effort to maintain a friendly ecology, I did this:
template: Definition
--chunk: typeDefinition
----chunk: nodeThumbnail
----chunk: nodeTags
template: Model
--chunk: typeModel
----chunk: nodeThumbnail
----chunk: nodeTags
template: Pattern
--chunk: typePattern
----chunk: nodeThumbnail
----chunk: nodeTags
etc.
The goal is to call
typeWhatever in my template and in a getResources page. The obvious problem is that getResources requires [[+reference]] syntax, not [[*tv]] syntax. I’ve come up with the following solutions to allow the sharing of chunks, but I want an even better solution.
- Use this [[+id:empty=`[[*id]]`]] syntax to ensure the chunks work with both.
- Or, use a giant property set on every chunk in the solo templates that defaults every [[+this]] to [[*this]]. Again, not very pretty.
- Combine these two options, so that the default properties for each chunk connect [[+id]] to [[+id:empty=`[[*id]]`]]. Cleaner templates, but it’s just hiding all the crazy.
- Use [[+this]] syntax universally, and in my templates, use getResources to call even single pages. This has the best organization of logical levels, but it obviously brings up concerns about speed/efficiency.
So... What can I do better?
Thanks.