Default template

Hi,

I’ve been having some trouble understanding the concept of the “default template.” Can someone confirm or correct me on the following points:

[ul]
[li]It doesn’t just apply if you are using dispatch templates.
[/li][li]The idea to set up a default template per combination of content type and site.
[/li][li]You have to do this by manually checking that only one template for each content type and site has the “Default” radio button in the Publish section of the General tab selected. (This could get pretty complicated with page templates that are shared by multiple content types. Is there a method to deal with these?)
[/li][/ul]
If there is a passage of text somewhere that concisely explains how the “default_template” field in Content Lists relates to the Always/Default/Never radio buttons on the General tab of templates in Workbench, then I’d really appreciate getting hold of copy. I have to say that the existing documentation (that I can find) on this topic is pretty poor. My searches have only found little bits spread across different pages and manuals. Some of these are, or appear to be, contradictory. Specifically, on page 167 of the Rhythmyx Implementation Guide it says a dispatch template should:

be the only Template configured as Default for the Content Type with which it is associated. (In other words, on the General tab of the Template Editor, the Default radio button should be selected.)

This seems to be saying that to make a template the default template for a content type, click the Default radion button in that template. However, the help files you get when you press F1 while editing a template it says the following about the default radio button:

Default: Publish this Template if it is the Default Template for the Content Type.

So is this radio button the way to make a template the default template, or is it the way to specify it should be published if it is the default template?

Andrew.

Andrew,

Unfortunately, the meaning of “Default” changed somewhat between 5.x and 6.x, and there’s probably a bit of documentation that still not properly updated.

There are 2 basic purposes for the Default template. The first is it’s use in snippets. In most snippets you will find a binding:

$pagelink = $rx.location.generate($sys.assemblyItem);

This link selects the Default template for the content type. This purpose here was to keep the names and ids of the page templates out of the snippets.

As you surmised, the default template is filtered by site. If there is more than one for the site, the system picks the “first” one. You don’t want this to happen, but it’s your responsibility to make sure that there is not more than one.

The second use of Default template is in Site Folder Publishing. When you select the SiteFolderTemplateExpander in your content list, it looks for the default template of each item and publishes it. If there are multiple default templates, it’s supposed to publish ALL of them.

This is different from 5.x, where a Default Variant was published if and only if the ID of the default variant was stored in the shared/defaultvariant field in the content item.

The proper approach to a situation where you need multiple page templates is to use a Dispatch template. Most commonly, this Dispatch template will also be the Default template. In the dispatch template, you will use the metadata of the item to determine which page template should be published for this item. All of these other page templates should be “Publish Never”.

In this case, the location scheme of the Dispatch template is used, not the location scheme of the target page template.

To answer your other question, the radio buttons in the template screen control whether or not this template is a Default template.

I hope this helps

Dave

Thanks Dave. I’ll need a while to process this information, and cogitate on its significance to our implementation.

Andrew.

Thanks Dave, I was scratching my head on how my predecessor implimented the PrimaryTemplateSelector Template. It’s clear on how it works and I plan on leveraging it in other projects.

Hello Dave,

I have a follow-up question: Can dispatch templates be used for snippets?

Thanks,

Andrew.

Yes. The Dispatcher is completely oblivious to the type of assembler or template used: you can dispatch pages, snippets, binary templates, database publishing templates, even other dispatch templates.

Dave

Thanks for the info again. I have successfully implemented this.