Multi-Output Preview

RELATED CONTENT

Multi-Output Overview

It is possible with XML/XSL to create multiple file outputs from the same PCF. This requires adding a PCF stylesheet declaration for each file type. Once the XSL has been updated the various outputs area also available to preview. Each additional output is reported as a page product and can be configured so that upon publish the multiple types of outputs are also published to the production server if necessary. The products may be different file type formats, such as HTML, PDF, RTF, CSV, XML, and mobile. The various output options are available from a drop-down when in the Preview mode of a page.

Multi-Output

The preview of each available output can seen by choosing the output type from the drop-down menu available when in the Preview mode of a page. 

Output Menu on Page Actions Toolbar

The menu items are variable depending upon template design and implementation, but usually named in correspondence with the various file types that were defined in the XSL using the pcf-stylesheet declaration. Some of the available options may include HTML, HTM (for use with mobile), and PDF.

Output Menu

PCF Stylesheet

Different products are achieved by adding an XSL document that defines the parameters for the formatting of the output. The various XSL files are called using the PCF stylesheet command. For example, the following pcf-stylesheet declaration is added to define a publish output in PDF format.

<?pcf-stylesheet path="/_resources/xsl/page2pdf.xsl" extension="pdf" alternate="yes" title="PDF"?>

The title attribute defines the menu item label that is available in preview mode.

There must be at least one such declaration in every PCF, but there is no limit to the number of such declarations that can be defined. The example pcf-stylesheet declaration has four attributes: The three attributes are the path, extension, alternate, and title.

The path attribute specifies the location of the XSL file to be used to generate the output, which will have the file extension defined in the extension attribute. Any output file always shares the file name of the PCF file with only the file extensions differing accordingly. Finally, the alternate attribute specifies that the declaration defines additional output that should be generated when the PCF file is published. In the example, this allows for the creation of an HTML document, as well as additional output of a CSV (comma separated values) file.

More Examples of PCF-Stylesheet Declarations

<?pcf-stylesheet path="/_resources/xsl/default.xsl" extension="html"?>
<?pcf-stylesheet path="/_resources/xsl/import/page2xml.xsl" extension="xml"?>
<?pcf-stylesheet path="/_resources/xsl/page2pdf.xsl" extension="pdf" alternate="yes" title="PDF"?>
<?pcf-stylesheet path="/_resources/xsl/page2csv.xsl" extension="csv"?>
<?pcf-stylesheet path="/_resources/xsl/page2rtf.xsl" extension="rtf"?>