From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 Description of problem: Templates can be created and associated with specific 'contexts' for a particular CMS content type - e.g. an 'xml' template can be associated with the alternate context. This template should be used to render items of this type when previewing and publishing. In the referenced build the default template associated with the 'public' context of a content type is used for all contexts. As a side-effect only one template can be used to render a content type. Version-Release number of selected component (if applicable): 29th July 2003 Nightly How reproducible: Always Steps to Reproduce: 1.Create a default template for the 'alternate' context 2.Preview or publish an instance of that content type. 3. Actual Results: The default public template is used. Expected Results: The newly created template should be used. Additional info: I have narrowed the problem down to 2 source files: The class com.arsdigita.cms.dispatcher.AbstractTemplateResolver should be checking for a HTTP parameter called 'templateContext' not just an attribute called this as it does currently. e.g. the corrected code is similiar to - String context = (String)request.getAttribute("templateContext"); if ( context == null ) { context = (String) request.getParameter("templateContext"); Currently it does not check for the parameter. This parameter is the mechanism used by the HttpHTMLProvider class when publishing. Also it appears that the getTemplateFromURL() within the AbstractItemResolver class should check if 'preview' is the first token when attemping to locate the context. Currently it incorreclty returns null for the context when previewing.
Closing old tickets