Choosing Templates for Publishing and Previewing

Recently, I’ve had some trouble getting my inter-preview links to work when I am using dispatch templates. I’ve finally discovered the reason.

On the “General” tab of each template, there is a “Publish” section. This section has always been something of a mystery to me as it’s not very intuitive as to what these settings meant. Unbeknown to me, these settings are actually quite nefarious. Here’s what I’ve learned so far:

[ul]
[li]Never: This template is never allowed to publish directly, nor are inter-preview links allowed to link directly to the variant_id of this template.[/li][li]Always: This template will publish whenever selected by a template expander. Inter-preview links are not allowed to link to this template unless specifically told to do so.[/li][li]Default: This template will publish whenever selected by a template expander. Inter-preview links will link to this template unless specifically told to do otherwise.[/li][/ul]

From these points, the following Best Practices can be derived:

[ol]
[li]Dispatch Templates should always be set to either “Default” or “Always” depending on your setup.[/li][li]Page Templates controlled by a Dispatch Template should always be set to “Never” and should be treated conceptually as if they were Snippet Templates.[/li][li]There should be only 1 Default template for any content type. Any more than one and the system will be forced to pick a random one from those available, and the result may be inconsistent.[/li][/ol]