Browser Preview Customization
XStandard is a content editor, therefore content authors use the editor to edit portions of a Web page, not the entire page. Some authors find it useful however to preview the content they produce within the layout of the actual Web page. You can add this feature by modifying the XSLT in preview.xsl, in order to customize the Browser Preview mode.
To instruct the Browser Preview feature to use a different CSS file, add the following XSLT rule to preview.xsl:
<xsl:template match="style">
<style type="text/css" media="screen">@import url('http://myserver/format.css');</style>
</xsl:template>
Layout markup can be added to preview.xsl in the following way:
<xsl:template match="body">
<body>
<h1><img alt="Welcome To My Site" src="images/logo.gif" /></h1>
<ul id="nav">
<li><a href="#" onclick="return false;">Home</a></li>
<li><a href="#" onclick="return false;">Products</a></li>
<li><a href="#" onclick="return false;">Services</a></li>
<li><a href="#" onclick="return false;">News</a></li>
<li><a href="#" onclick="return false;">About Us</a></li>
</ul>
<div id="content">
<xsl:apply-templates />
</div>
</body>
</xsl:template>
Content generated through the editor will be inserted into the page layout markup at the location <xsl:apply-templates />
.
To instruct the editor to use the customized Browser Peview file, give the location of the file in the <param>
tag named PreviewXSLT
. For example:
<param name="PreviewXSLT" value="http://myserver/preview.xsl" />