Modify the look of the text in the Preview view

You can change the look and feel of a topic viewed in the Preview view.

In the IXIASOFT CCMS Desktop, users can preview the topic in the Preview view by right-clicking the topic and clicking Show Preview. If the default format used in Preview view does not meet your needs, you can customize it by creating your own cascading style sheet (.css file) and declaring it in the preview.xsl file in the /system/xsl/html folder. You can also add parameters to the preview.xsl file to overwrite the build parameter defaults set in xsl/html/xslhtml/dita2htmlImpl.xsl to make other changes to the Preview view. By adding your customizations to the preview.xsl file, it will allow you to preserve your changes through upgrades.

  1. Open the TEXTML Administration perspective by clicking the TEXTML Administration shortcut on the tool bar. If the shortcut is not displayed, follow these steps:
    1. Select Window > Perspective > Open Perspective > Other
    2. Click TEXTML Administration.
    3. Click Open.
  2. In the TEXTML Administration view, double-click the server. If your server is not displayed in the view, you must add it to the view.
  3. When the Connect as dialog opens, type your username and password and click OK.
  4. Double-click the name of your Content Store to open a connection to it.
  5. Create your own cascading style sheet (.css file) or you can base yours on the existing style sheets in the Repository. To create a new style sheet based on an existing one:
    1. Expand the Repository folder and find the commonltr.css (for languages read left-to-right ) and commonrtl.css (for languages read right-to-left) files in the /system/xsl/resource folder.
    2. Right-click the file that you want to use and click Export. In the Destination folder box, type a path to a folder on your local disk or click Browse to choose a location. Under Export options, click to select the Content checkbox. Click Ok.
    3. Rename the exported style sheet so you do not overwrite the existing one in the Repository.
    4. Make the necessary changes to the file and then save it.
  6. Insert your style sheet into the /system/xsl/resource folder.
    1. Right-click the resource folder and click Insert Documents.
    2. Click the Add file button and select your new style sheet.
    3. Click OK.
  7. Declare your new style sheet in the preview.xsl file.
    1. Right-click the the preview.xsl file in the /system/xsl/html folder and click Check out.
    2. Double-click the file to open it in the editor.
    3. Find where the .css files are declared and replace the existing file name with the name of your new style sheet.

      For example:

      <xsl:param name="CSS"/>
      <!-- IXIASOFT PATCH: Assumes the xsl is used for preview and that the html is saved in /preview/ -->
      	<xsl:param name="dita-css" select="'../system/xsl/resource/MyPreview_commonltr.css'"/> 
      	<xsl:param name="bidi-dita-css" select="'../system/xsl/resource/MyPreview_commonrtl.css'"/> 
      <!-- END PATCH -->
    4. Save, close, and check in the file.
  8. Overwrite the build parameter defaults, if required.
    1. Open the dita2htmlImpl.xsl file found in xsl/html/xslhtml/ and then copy the parameter that you want to overwrite.
    2. Paste it in the preview.xsl file and change its values as required.
    3. Save, close, and check in the file.
    For example, if you wanted to show the draft-comment element in the Preview view, you would paste and edit the parameter as follows:
    <!-- default "hide draft & cleanup content" processing parameter ('no' = hide them)-->
    <xsl:param name="DRAFT" select="'yes'"/>
  9. Inform users of the changes and request that they close and reopen their IXIASOFT CCMS Desktop to apply the changes.
For example, the preview.xsl file would look like this:

<?xml version="1.0" encoding="UTF-8" ?>
<!-- This file is part of the DITA Open Toolkit project hosted on 
	Sourceforge.net. See the accompanying license.txt file for applicable licenses.-->
	<!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved. -->
			
	<!-- ereview.xsl | DITA topic to HTML for ereview & webreview -->
			
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:saxon="http://icl.com/saxon"
	xmlns:xt="http://www.jclark.com/xt"
	extension-element-prefixes="saxon xt">
				
	<!-- stylesheet imports -->
	<!-- the main dita to xhtml converter -->
	<xsl:import href="dita2xhtml.xsl"/>
				
	<xsl:output method="html"
		encoding="UTF-8"
		indent="no"
		doctype-system="http://www.w3.org/TR/html4/loose.dtd"
		doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
		/>
				
	<xsl:param name="CSS"/>
	<!-- IXIASOFT PATCH: Assumes the xsl is used for preview and that the html is saved in /preview/ -->
	<xsl:param name="dita-css" select="'../system/xsl/resource/MyPreview_commonltr.css'"/> <!-- left to right languages -->
	<xsl:param name="bidi-dita-css" select="'../system/xsl/resource/MyPreview_commonrtl.css'"/> <!-- bidirectional languages -->
	<!-- END PATCH -->
				
	<!-- default "hide draft & cleanup content" processing parameter ('no' = hide them)-->
	<xsl:param name="DRAFT" select="'yes'"/><!-- "no" and "yes" are valid values; non-'yes' is ignored -->
				
</xsl:stylesheet>