Preview Page & Button
Posted: 2011-01-06 03:42
Hi guys, I am having an issue creating the preview page in KTML,(first time I've used KTML). I have followed the tutorial here http://www.interaktonline.info/document ... ntprev.htm.
Here is the code I have is it correct?
I can't even see the preview button which I've uploaded to the server. The KTML object is the one in my page a nextensio form text area.
Thanks Chris
Here is the code I have is it correct?
Code: Select all
<script>
function previewKTML(k) {
k.save(function() {
var value = k.formElement.value;
wnd = utility.window.openWindow("ktml_preview_window", k.iframeSRC2, window.screen.availWidth-5, window.screen.availHeight - 45);
if (wnd) {
html = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' + "\r\n";
html += '<html><head><link href="' + k.getModuleProperty("css", "PathToStyle") + '" rel="stylesheet" type="text/css"></head><body>';
html += value;
html += '<input type="button" value="Close" onclick="window.close()" />';
html += '</body></html>';
wnd.moveTo(-3,-3);
wnd.document.open("text/html; charset=" + k.charset);}
wnd.document.write(html);
wnd.document.close();
}
});
}
var previewButton = new ToolbarButton({
'name': 'preview',
'button_type': 'img',
'button_icon': KtmlRelativeImagePath + 'preview.gif',
'command_type': $KT_JS_STRING,
'command_string':'previewKTML(this.ktml)'
});
<script type="text/javascript">
// KTML4 Object
ktml_article_art_<?php echo $cnt1; ?> = new ktml("article_art_<?php echo $cnt1; ?>");
</script>
Thanks Chris