Im trying to call a different TPL for static preview when a user clicks preview - i did RTFM and have spent a day on it, but cant get the calls to work properly. any help would be appreciated.
requirements:
- if a user clicks on the "preview" button, they get a TPL for static preview (preview.tpl)
- if the user clicks on "generate" button, they do not see the "select a tpl" screen and go directly into a different tpl (academic-calendar.tpl)
first, i updated templating.cfg to include both tpls for that category?
[HTML]
[/HTML]
here is a snippet from my JS
[HTML]function init() {
// Register a function to handle Save.
IWEventRegistry.addFormHandler("OnPreview", setPreviewTPL);
// Register a function to handle Save.
IWEventRegistry.addFormHandler("onSave", saveHandler);
}
// This function is called when user clicks preview
function setPreviewTPL() {
IWPageGeneration.getValidPresentationTemplates();
tpl = "preview.tpl";
IWPageGeneration.setPresentationTemplate(tpl);
return true;
}[/HTML]